Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Begins With

Author  Topic 

jcb267
Constraint Violating Yak Guru

291 Posts

Posted - 2009-03-12 : 12:53:44
I am running a query in SQL 2005 against a database that includes a date field that is formatted as char(6).

The field is a providers medicare number, which is 6 digits in length. The first 2 digits represent the state (E.G. 22 = Massachusetts)

I would like to run a query that will filter all records by state code but cannot get it to work. Can anyone help?

I am trying something like this where (hosp_rpt.prvdr_num in 22).

Thanks!

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-03-12 : 13:07:46
where hosp_rpt.prvdr_num LIKE '22%'
Go to Top of Page

jcb267
Constraint Violating Yak Guru

291 Posts

Posted - 2009-03-12 : 14:50:38
quote:
Originally posted by visakh16

where hosp_rpt.prvdr_num LIKE '22%'



Great, thanks for the help - it worked perfect!

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-03-13 : 13:06:57
welcome
Go to Top of Page
   

- Advertisement -