Using COUNT FUN and CAST

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • darkdirk1
    New Member
    • Oct 2006
    • 50

    #1

    Using COUNT FUN and CAST

    SQL Value:
    Code:
    "COUNT(tbl__UserLog._UserLog_ID) AS Count_Logins "
    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__User Log._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.
Working...