On Aug 13, 6:08*pm, Prav <P...@discussions.microsoft.com> wrote:
> Hi I have the following records in my table:-
>
> PTR22334
> AA0123
> HDA/C001
> '
> E/Y001
> FG
> Z12345
> 000000123456
> 000078910112
>
> How can my query return only 123456 & 78910112 only.
Am I missing the point?
SELECT DesiredField
from MyTable
where left( DesiredField,1) = '0'
or
SELECT DesiredField
from MyTable
where left( DesiredField,4) = '0000'
If leading zeroes are to be eliminated
SELECT CInt( DesiredField )
from MyTable
where left( DesiredField,1) = '0'
|