View Full Version : Dates query issue


wiggychoo
08-04-2009, 02:35 AM
I have a lookup table where each record represents a quarter of a year. An example would be 1 January to 31 March 2009 which would be called "Quarter 1 2009" in my table.

In addition to this "name" field, the table also contains date fields containing the quarter start-date and quarter end-date (01/01/09 and 31/03/09 in my example).

What I want to do is to use the lookup table to return the relevant quarter for a record in another table which also contains a date field. If, say, the record in the other table has a date value of 14/02/09, I would want the query to tell me that this date falls in "Quarter 1 2009".

Any ideas on how I might do this?? Many thanks.

DCrake
08-04-2009, 03:26 AM
Period = "Quarter " & format([DateFieldName],"q") & " " & Format([DateFieldName],"yyyy")

David

wiggychoo
08-05-2009, 05:06 AM
Worked a treat - thankyou. :)