Re: Compare two column values with leading zeros Perhaps try an integer comparison instead by converting the number to
integer:
SELECT * from BOL where CONVERT(INTEGER, BOLNumber) = 1234
(no idea if this syntax is correct!)
"Girish" <kattukuyil@hotmail.com> wrote in message
news:b2bb38a.0410060557.3479f77e@posting.google.co m...
> Hey,
>
> This is what I would like to do:
> ===========
> Declare @chvBOLNumber
> Set @chvBOLNumber='0001234'
> Select * from BOL where BOLNumber=@chvBOLNumber
> I want to return the row/rows when BOLNumber=1234
> ============
>
> The problem is the leading zeros. @chvBOLNumber can be 01234 or 001234 or
> ...
>
> Hope the above makes sense. How can I do this ? (probably using wildcards)
>
> Thanks, John |