|
Prev: Select returns no rows within TRY... END TRY
Next: "Not Null Default" column behavior change in SQL 2K and SQL 2005
From: Seth Williams on 18 Jul 2008 11:46 I have a column that has batch numbers, but it's a varchar column "WHERE batch between 1500 and 1625" I need to find out if that batch numbers are between 1500 and 1625, however I'm getting an error: The conversion of the varchar value '2393337112' overflowed an int column. Maximum integer value exceeded. How can I get around this?
From: Tom Cooper on 18 Jul 2008 11:55 WHERE Cast(batch as bigint) between 1500 and 1625 Tom "Seth Williams" <sm(a)here.com> wrote in message news:uyvYp1O6IHA.2348(a)TK2MSFTNGP06.phx.gbl... >I have a column that has batch numbers, but it's a varchar column > "WHERE batch between 1500 and 1625" > > I need to find out if that batch numbers are between 1500 and 1625, > however I'm getting an error: > The conversion of the varchar value '2393337112' overflowed an int column. > Maximum integer value exceeded. > > How can I get around this? > >
From: nlulla on 18 Jul 2008 12:35
Try WHERE Cast(batch as numeric(26,10)) between 1500 and 1625 Regards lulla |