Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

SQL BETWEEN 'DATES'

JamesFosJamesFos Posts: 240Member
I'm using Jet 4.0 and SQL to control an MS Access DB.

I have an sql statement.

SELECT Field1,
Field2,
Field3,
Expr1 AS ExprName1,
Expr2 AS ExprName2
FROM Tabel1,
Tabel2
WHERE Tabel1.PrimeKey = Tabel2.ForeignKey AND
Field2 BETWEEN '14/08/2001' AND '14/09/2001'

When i run it the server brings up an error "Invalid data type in condition statement". When i take out the part..

"Field2 BETWEEN '14/08/2001' AND '14/09/2001'"

.. it works fine and i have to restrict the date in the code (i'm using VB with SQL to access the data base).

does anyone know whats wrong? the code would be a lot simpler if the SQL statement could work.

TIA

Comments

Sign In or Register to comment.