ADO Recordset Source with BETWEEN dates criteria

M

Medhat Nasr

Hi Group,

Working with Access 2002 and SQL 2000,
For an ADODB Recordset's Source I use this syntax :

rst.Source = "SELECT GteeID, CurExpiryDte FROM " & _
"dbo.Guarntees WHERE (CurExpiryDte BETWEEN '" & _
strChkDurEnd & "' AND '" & strTodayIs & "')"
rst.Open

This only opens the correct Recordset , when the date represented
by the first date literal after BETWEEN operator, precedes the other
date,meaning when 'strChkDurEnd' is < 'strTodayIs' .
But, if 'strChkDurEnd' is > 'strTodayIs' it doesn't work properly, and no
recordset opens!

I wonder if this one-direction correctly handling of the BETWEEN operator in
such a syntax, is a standard behavior of SQL ?

Thanks in advance,
 

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