SQL statement

anb001

Registered User.
Local time
Today, 16:31
Joined
Jul 5, 2004
Messages
197
I have the following SQL statement:

Code:
     strSQL = "SELECT DISTINCT tblDeadline.Direction FROM tblDeadline "
     strSQL = strSQL & " WHERE tblDeadline.Port = '" & cboPort.Text & "' AND tblDeadline.Service = '" & cboService.Text & "'"
     strSQL = strSQL & " ORDER BY tblDeadline.Direction;"

Problem is that I can't get the 'AND' part to work. What have I made wrong??

Thanks.
 
Code:
     strSQL = "SELECT DISTINCT Direction FROM tblDeadline "
     strSQL = strSQL & "WHERE Port = """ & cboPort & """ AND Service = """ & cboService & """"
     strSQL = strSQL & " ORDER BY Direction;"
 

Users who are viewing this thread

Back
Top Bottom