Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with where statement...

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
hi there, i'm currently trying to create a sql query in visual basic but however it is giving me some problem..
'
Dim mydata As String
searchSQL = "select Daily, Earning from ProgressChart "
searchSQL = searchSQL & "where Daily =" & mydata
'
i tink the problem is that when u use the where statement.. the criteria needs to hav a ' '...
pls kindly help me with the problem...
 

You must provide the single quote "'" if U use string type data

so write as,
searchSQL = searchSQL & "where Daily ='" & mydata & "'"

instead of
searchSQL = searchSQL & "where Daily =" & mydata


Madhu.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top