Dates (1 Viewer)

TRWguy

New member
Local time
Today, 07:03
Joined
Jul 5, 2002
Messages
8
Im sure this is simple but I'm not that good with queries.

I have a table with a bunch of orders from clients, and one of the fields is the date that they ordered the stuff. I need to make a query that finds all orders that are over a week old.

Any Help would be appreciated
Thank You
 

TRWguy

New member
Local time
Today, 07:03
Joined
Jul 5, 2002
Messages
8
Rich,

I looked at the thing you sent me and entered this code <=Date()-"7" into the criteria section under the Field Date, but it doesn't work the query still gives me all the entries in my table instead of the ones im looking for.

If you could tell me if my code is wrong or im doing something else wrong your help would be appreciated.

Thank you
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 07:03
Joined
Feb 19, 2002
Messages
43,302
The 7 is numeric and therefore should not be enclosed in quotes.

<=Date()-7
 

TRWguy

New member
Local time
Today, 07:03
Joined
Jul 5, 2002
Messages
8
When I enter the expression in, it automatically adds the quotes and wont let me take them out do you know how

Thank You
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 07:03
Joined
Feb 19, 2002
Messages
43,302
Your date field must be defined as a text string rather than as a real date/time data type. Make a backup of the table then open it in design view and change the datatype to date/time. If any rows contain invalid dates, their data will be lost - hence the need for a backup. You'll need to fix the bad data manually.
 

TRWguy

New member
Local time
Today, 07:03
Joined
Jul 5, 2002
Messages
8
Thanks

Thank You Pat, you were right, that fixed all my problems
 

Users who are viewing this thread

Top Bottom