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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Statement syntax error

Status
Not open for further replies.

starclassic

Technical User
May 24, 2007
27
US
Not sure whats wrong with the statement..

StrSql = " SELECT *" _
& "FROM tblContact " _
& "WHERE tblContact.OtherExplain Is Null " _
& "And tblContact.GComments Is Null" _
& "And tblContact.ByPhone = 0" _
& "And tblContact.LeftMessage = 0" _
& "And tblContact.Promise = 0" _
& "And tblContact.Other = 0" _
& "And tblContact.ContactNumber = 1" _
& "And tblContact.FollowUpDate Between #" & Format(Forms!frmQueue!txtFollowUpDateStart, "mm/dd/yyyy") _
& "# And #" & Format(Forms!frmQueue!txtFollowUpDateEnd, "mm/dd/yyyy") & "# And tblContact.MessageType ='A-306'"

' Syntax Error on Sql statement
Set rst = dbs.OpenRecordset(StrSql)

Any help will do.. Thanks
 
Some rows are missing a space at the end (or the beginning of the subsequent row:

Code:
StrSql = " SELECT *" _
    & "FROM tblContact "

There is no space after the "*"

Ed Metcalfe.

Please do not feed the trolls.....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top