dynamictiger
Registered User.
- Local time
- Today, 04:23
- Joined
- Feb 3, 2002
- Messages
- 270
Thanks to everyone for looking into this. It really has me baffled.
I have two online SQL databases I am linking to in Access in order to produce multiple reports, queries and so on.
Both databases contain dates and typical for SQL the date on the linked table is formatted dd-mm-yyyy hh:nn:ss.
I am running two different queries. The first finds chemical results and limits the records by date (this is from one of the SQL linked tables). The relevant section of the query is:
In short I am trimming the time from the date and leaving just the date then query with yyyy-mm-dd. This works and reliably works.
On another query I have a similar requirement. I am wanting to return time records between two specific dates. If I add:
This query returns nothing at all. Yet the underlying data looks identical in every way???
If I change the query to:
I get nothing
Or
I get no records
Or
Still nada
And
Appears to be ignoring the criteria regardless of which way I configure the date.
I understand dates can be confusing, but this is past confusing and becoming threatening to my remaining hair follicles. I am really flumoxed and am starting to wonder about alternative approaches. I was hoping someone has come across an equally baffling situation and may give me a better pointer than here is a link to so and so website. I promise I have tried it.
I have two online SQL databases I am linking to in Access in order to produce multiple reports, queries and so on.
Both databases contain dates and typical for SQL the date on the linked table is formatted dd-mm-yyyy hh:nn:ss.
I am running two different queries. The first finds chemical results and limits the records by date (this is from one of the SQL linked tables). The relevant section of the query is:
Code:
Left([LogTime],10)) Between '2019-01-01' And '2019-01-10')
In short I am trimming the time from the date and leaving just the date then query with yyyy-mm-dd. This works and reliably works.
On another query I have a similar requirement. I am wanting to return time records between two specific dates. If I add:
Code:
WHERE (((Left([StartTime],10)) Between '2019-1-1' And '2019-05-01'
This query returns nothing at all. Yet the underlying data looks identical in every way???
If I change the query to:
Code:
WHERE (((Format(Left([StartTime],10),'mm\/dd\/yyyy'))>=#3/7/2019#)
Or
Code:
WHERE (((Format(Left([StartTime],10),'mm\/dd\/yyyy'))>=7/3/2019));
Or
Code:
WHERE (((Format(Left([StartTime],10),'mm\/dd\/yyyy'))>='7/3/2019'));
And
Code:
WHERE (((Left([StartTime],10))>=3-7-2019));
I understand dates can be confusing, but this is past confusing and becoming threatening to my remaining hair follicles. I am really flumoxed and am starting to wonder about alternative approaches. I was hoping someone has come across an equally baffling situation and may give me a better pointer than here is a link to so and so website. I promise I have tried it.