Page 1 of 1

mssql

Posted: Thu Jan 15, 2009 9:42 pm
by kipp
I am trying to perform a SELECT query and when I call for fields other than the id column I get nothing in the results. When I call the id it pulls results properly. I must be missing something....

I use the following:

SELECT * FROM adminVol WHERE u='username1'

this works though

SELECT * FROM adminVol WHERE id='1'

any thoughts?

Re: mssql

Posted: Thu Jan 15, 2009 10:16 pm
by kipp
Figured it out...mssql won't let you compare text values with the = operator. I found a quick fix by using the following instead:

SELECT * FROM adminVol WHERE CONVERT( VARCHAR, u )='admin'