A Mind Of It's Own? (1 Viewer)

shuff

Registered User.
Local time
Today, 15:22
Joined
Oct 13, 2000
Messages
61
I have a simple, simple query based on a linked SQL table with a date/time field called "CHANGEDT." All I want to do - as I have done many times before - is to set criteria for that field of Date()-10 (records changed 10 days ago). Every time I get an empty data set, even though I know there are records in the table for the target date. There are no other criteria in this query, no linked tables or anything like that - just a siiiiiiiiimple query! Sheesh!

What would make a query NOT respond as expected when calculating a date 10 days in the past? I'm thinking that my frustration is causing me to overlook something obvious.

Thanks-
SLH
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 07:22
Joined
Aug 30, 2003
Messages
36,134
Does the field include a time component?
 

shuff

Registered User.
Local time
Today, 15:22
Joined
Oct 13, 2000
Messages
61
Yes, it is the standard date/time date plus hh:mm:ss:hh

SLH
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 07:22
Joined
Aug 30, 2003
Messages
36,134
Then trying to match a date alone will likely not result in a match, unless the time on a record is 00:00:00, since that's the unspecified default. You either need to extract the date portion alone and use that in your criteria (Format), or use Between and concatenate ' 00:00:00' and ' 23:59:59' to your starting and ending dates, respectively.
 

Users who are viewing this thread

Top Bottom