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.
Author |
Topic |
kemi2299
Starting Member
41 Posts |
Posted - 2008-04-04 : 09:27:30
|
could you pls check this query, i need to convert the varchar to int but i am getting errorConversion failed when converting the varchar value '*' to data type int. what is missing?SELECT count(Mrn) as counter, month_Att,Attendance_Cat_Cd into #lcdq16b from #lcae where convert(varchar,Attendance_Cat_Cd )= 1 group by month_Att,Attendance_Cat_Cd ; |
|
elancaster
A very urgent SQL Yakette
1208 Posts |
Posted - 2008-04-04 : 09:33:26
|
quote: Originally posted by kemi2299 could you pls check this query, i need to convert the varchar to int but i am getting errorConversion failed when converting the varchar value '*' to data type int. what is missing?SELECT count(Mrn) as counter, month_Att,Attendance_Cat_Cd into #lcdq16b from #lcae where convert(varchar,Attendance_Cat_Cd )= 1 group by month_Att,Attendance_Cat_Cd ;
the problem is this bit in redcould you not just say where attendance_cat_cd = 1? the conversion to varchar seems pointless as it is?what datatype is it to start with?Em |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|