convert datatype and use as criteria in query

  • Thread starter Thread starter djc
  • Start date Start date
D

djc

I successfully used CInt(FieldName) As Expr1 in
the field list part of my SELECT statement. Seemed to work fine. But now how
can I also use this value (the converted value) as part of my WHERE clause?
I tried these 2 ways unsuccsessfully:

a: WHERE CInt(FieldName) > 0
b: WHERE Expr1 > 0

Neither worked (Type conversion error). How can I do this. I have this
string data type that I need to convert to an integer, use as part of
criteria, and possibly do math on it... do I need to use subqueries?

??
 
SELECT Table1.ID, CInt([Text01]) AS Expr1
FROM Table1
WHERE (((CInt([Text01]))>0));

works fine for me in A2K2.

Try compacting and repairing your database.
 
Back
Top