Re: Removing zeros

Re: Removing zeros

 

  


SELECT SUBSTRING(number_column,CHARINDEX
('00',number_column),LEN(number_column))


To break it down for you...

It will select from where the first occurrence of the pattern '00' begins
to the end of the column.

Regards


__________________________________________
Anthony Hand
DBA | Systems Integration
Aon Risk Services Australia Ltd
Ph: +61 2 9253 7516
Fax: +61 2 92537952
Mob: +61 415 877 988




"Usman Farhat"
<Usman.[Email Address Removed] To: "LazyDBA.com Discussion" <[Email Address Removed]
ogroup.it> cc:
bcc:
19/06/2003 06:39 Subject: Removing zeros
PM






Hi Everyone,

In SQL Server if there is any function to remove leading zeros. For example
if we have expression 00765 . Function should
result in 765.

Thanks,
Usman


--------------------------------------------------------------------
NOTA CONFIDENZIALE:
Questo messaggio ed i suoi allegati sono indirizzati esclusivamente
alle persone indicate in testa e possono contenere informazioni
confidenziali. Se avete ricevuto il messaggio per sbaglio, sappiate
che qualunque utilizzo improprio del contenuto è proibito, Vi
preghiamo quindi di inoltrarlo immediatamente al mittente e di
cancellare il messaggio. Per qualsiasi informazione vi inivitiamo a
contattarci scrivendo a [Email Address Removed] NOTICE:
This message and its attachments are addressed solely to the persons
above and may contain confidential information. If you have received
the message in error, be informed that any use of the content hereof
is prohibited. Please return it immediately to the sender and delete
the message. Should you have any questions, please contact us by replying
to [Email Address Removed] you
--------------------------------------------------------------------

---------------------------------------------------------------------
TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To unsubscribe, e-mail: mssqldba-[Email Address Removed] additional commands, e-mail: mssqldba-[Email Address Removed]MS Sql Server LazyDBA home page