Using between and operators in OpenRecordSet

L

Luc

I'm trying to use the between and operators
in a recordset like this:

Set rstin = dbs.OpenRecordset("Select * From
tblTenantsinSplit Where StartDate Between #" & varDateBeg
& "# And #" & varDateEnd & "# _
Or EndDate Between #" & varDateBeg & "# And #" &
varDateEnd & "#")

For some reasom I get a syntax error.
Does anyone see any reason why i'm getting this error?
TIA.
 
B

Brendan Reynolds

Your line-continuation is inside the string. Try changing ...

& "# And #" & varDateEnd & "# _

.... to ...
& "# And #" & varDateEnd & _
"# Or etc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top