View Full Version : Help in the right direction with dates please


Stuart Green
10-31-2002, 04:25 AM
I would appreciate a "push" in the right direction with the following. I have table for recording dates that staff take their holidays. It has a startdate and an enddate fields. I would like to be able to enter a date as a criteria (or even better a range of dates) and for the query to pull up all the records where this criteria falls between the stardate and endate values. I can't even think where to start on this.

Hayley Baxter
10-31-2002, 05:01 AM
Enter this criteria in your query

between [startdate] and [enddate]

This should now prompt you for the start date and the end date and produce the results you enter.

HTH
Hay

Stuart Green
10-31-2002, 06:39 AM
Hayley, which field am I applying this criteria to? I can't put the criteria into a blank column. There are 3 fields, startdate, enddate and name. I would like to list all records where the start and end date period spans the input criteria

Hayley Baxter
10-31-2002, 06:43 AM
Put it under your start date column and that should work.

Stuart Green
10-31-2002, 07:23 AM
Hi Hayley. Thanks for your help here. This option you suggested will list all records as the start date is always between startdate and enddate. I tried it and the option to input criteria doesn't come up, it just runs. A typical record may contain start date as 1 january and enddate as 20 January. I want to input as a criteria 15 January and list any records where 15 January is spanned. I am obviously missing something here, sorrry

Hayley Baxter
10-31-2002, 07:28 AM
Hi Stuart

I attached an example in this thread that might help you.

http://www.access-programmers.co.uk/forums/showthread.php?s=&threadid=32050

Stuart Green
10-31-2002, 07:50 AM
.....and lo, the mist was lifted from his eyes!! Thanks you very much for the patience and prompt response, I will now go and show off to my colleagues how clever I am

Hayley Baxter
10-31-2002, 07:59 AM
Good for you!!