469,622 Members | 2,112 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,622 developers. It's quick & easy.

Using COUNT FUN and CAST

SQL Value:
Expand|Select|Wrap|Line Numbers
  1. "COUNT(tbl__UserLog._UserLog_ID) AS Count_Logins "
  2.  
Returns as varchar which is killing me, because my user interaction is loaded w/ sort features. Unfortunately the count_logins var getting posted to the script is an integer.
So I recieve :
Syntax error converting the varchar value 'Count_Logins' to a column of data type int.
When the post var gets compared to the AS Count_Logins var (in a Dynamic WHERE clause)....
If I convert the post var to a string - it returns no results?!?!

I have tried unsuccessfully to use CAST to convert the type w/ in the sql statement.

I don't even understand why the heck COUNT(tbl__UserLog._UserLog_ID) AS Count_Logins is not an INT by default!?!?

Any advice is so appreciated as I have researched/experimented now for hours unsuccessfully and need to go home like 1.5 hours ago.


thanks 2 you.
Nov 10 '06 #1
0 1322

Post your reply

Sign in to post your reply or Sign up for a free account.

By using this site, you agree to our Privacy Policy and Terms of Use.