views:

79

answers:

2

hey guys im trying to do a SELECT Statement from a local SQLDB so my statement is something like select ..etc..etc WHERE Date =%@,theDate

theDate is an NSString variable. i NSLoged theDate and it returned 22/06/2010

But it doesnt work so i tried the following select ..etc..etc WHERE DATE ='22/06/2010'

And the values came by. any idea why this happens? In the SQLDB, the column type for DATE is NVARCHAR though. does that matters?

+1  A: 

from your question it looks like including single quotes around the %@ token might be worth a shot

"select....etc. etc. ...WHERE Date ='%@'",theDate
potatopeelings
cool thx. works now.
Kenneth
A: 

ahhh this just reminded me (and probably everyone else ) of the "select is not broken" blurb in prag prog... carry on

RhysC