Hello All
I’m trying to use an SQL string in VBA code, but I’m getting the error 3057 Syntax error (missing operator) due to the SQL I’ve entered. It’s going to be something like my date format, but I’ve tried what little I know and it hasn’t worked.
Here’s my SQL: –
strWordSQL = “SELECT * FROM PrimaryDataTbl WHERE DateReceived BETWEEN # ” & Me.StartDateTxt & ” # AND # ” & Me.EndDateTxt & ” # VendorNumber = ” & Me.VendorNumber
I’ve tried it without the # marks around the dates. Added them in the hopes it was as simple as having to put the ‘ before any text items referred to in a SQL string.
Using the de###### shows me that all three me.statements have the values in, using the SQL in the QBE window (with minor mods to suit the criteria) gives me the results I want……
Please, help while I still have a little hair left that isn’t either grey or on the desk
Thanks
Ian