Select query with date condition

calendar_today Asked Nov 15, 2010
thumb_up 17 upvotes
history Updated April 14, 2026

Direct Answer

Be careful, you're unwittingly asking "where the date is greater than one divided by nine, divided by two thousand and eight". Put # signs around the date, like this #1/09/2008#. This is a prose walkthrough, ranked #12th of 67 by community upvote score, from 2010.


The Problem (Q-score 6, ranked #12th of 67 in the Access VBA archive)

The scenario as originally posted in 2010

I would like to retrieve the records in certain dates after d/mm/yyyy, or after d/mm/yyyy and before d/mm/yyyy, how can I do it ?

SELECT date
FROM table
WHERE date > 1/09/2008;

and

SELECT date
FROM table
WHERE date > 1/09/2008;
AND date < 1/09/2010

It doesn’t work.

Why community consensus is tight on this one

Across 67 Access VBA entries in the archive, the accepted answer here holds elite answer (top 10 %%) status — meaning voters are unusually aligned on the right fix.


The Verified Solution — elite answer (top 10 %%) (+17)

Verbal answer — walkthrough without a code block

Note: the verified answer is a prose walkthrough. If you need a runnable sample, check Access VBA entries ranked in the top 10 of the same archive.

Be careful, you’re unwittingly asking “where the date is greater than one divided by nine, divided by two thousand and eight”.

Put # signs around the date, like this #1/09/2008#


When to Use It — vintage (14+ years old, pre-2013)

Ranked #12th in its category — specialized fit

This pattern sits in the 45% tail relative to the top answer. Reach for it when your scenario closely matches the question title; otherwise browse the Access VBA archive for a higher-consensus alternative.

What changed between 2010 and 2026

The answer is 16 years old. The Access VBA object model has been stable across Office 2013, 2016, 2019, 2021, 365, and 2024/2026 LTSC, so the pattern still compiles. Changes that might affect you: 64-bit API declarations (use PtrSafe), blocked macros in downloaded files (Mark-of-the-Web), and the shift toward Office Scripts for web-first workflows.

help
Frequently Asked Questions

Why is this answer the top decile of Access VBA Q&A?
expand_more

Answer score +17 vs the Access VBA archive median ~5; this entry is elite. The score plus 6 supporting upvotes on the question itself (+6) means the asker and 16 subsequent voters all validated the approach.

The answer has no code block — how do I turn it into a snippet?
expand_more

Use the walkthrough above as a checklist, then open a top-10 Access VBA archive entry for a concrete starting template you can adapt.

This answer is 16 years old. Is it still relevant in 2026?
expand_more

Published 2010, which is 16 year(s) before today’s Office 2026 build. The Access VBA object model has had no breaking changes in that window. Three things to re-test: (1) blocked macros on downloaded files (Mark-of-the-Web), (2) 64-bit API declarations (PtrSafe, LongPtr), (3) any shift toward Office Scripts for web scenarios.

Which Access VBA pattern ranks just above this one at #11?
expand_more

The pattern one rank above is “GUI interface for sqlite data entry in Python”. If your use case overlaps, compare both before committing.

Data source: Community-verified Q&A snapshot. Q-score 6, Answer-score 17, original post 2010, ranked #12th of 67 in the Access VBA archive. Last regenerated April 14, 2026.