Find all records where provided date is 1 year ago

henry_s

New member
Local time
Today, 05:09
Joined
Aug 25, 2004
Messages
5
Hi,

I currently have a database with a field for a month, and another field for a year. These are not date fields, their Text + Number fields. The Month field contains the 3 letter abbreviation for the month (e.g. Jan, Feb, etc)

I'm presuming I'm going to have to create a single field to combine the two month/year fields into one date field. However I'd rather not if it was possible to complete the query with the existing table design.

The query has to find the current month + year, and then find all of the records which have a month/year listed that is more than a year old.

E.g.

It's now October '04, and I want to find all records that have the month/year down as October 2003 or earlier.

If anyone understood any of my rambling, you deserve a medal.

So - could anyone help me out? Even if you could just suggest a couple of things that I can research that could help me accomplish my goal would be great.

Thanks a lot for your time.
 
SELECT *
FROM [TableName]
WHERE CDate("1-" & [Month] & "-" & [Year])<= DateSerial(Year(Date())-1,Month(Date()),1)
ORDER BY CDate("1-" & [Month] & "-" & [Year]) DESC;
 

Users who are viewing this thread

Back
Top Bottom