Start Date and End Date question

joe31709

Registered User.
Local time
Today, 18:01
Joined
May 12, 2003
Messages
54
I have a table for leave. it has a start date and end date. Such as start date 12/6/2004 and End date 12/9/2004 , In my Query I have it where you can enter the date and it will tell you who is on leave for that day as long as its in the start date. Is there a way possible for it to look at both dates and if I type in 12/7/2004 It will return a value?

Thanks
 
Look in the help files for the "Between ... And" operator as a way to determine whether something is between two other somethings of the same data type.

Remember that if you stored the fields as type Date and your comparator came in as part of an input box or a text control on a form, the comparator number is in TEXT format and must be converted first. Perhaps with CDate function, which is also in the Help files.
 
I read that but I dont understand it. I am alittle slow at times :p

my names are Sdate and Edate.

Do i add the stuff in to criteria?
 
You'll need to make a new field in your query and add criteria to that.

In the SQL View in you query you would see something like this:

SELECT tblVacation.EmployeeName, tblVacation.SDate, tblVacation.EDate
FROM tblVacation
WHERE ((([VacationDate])>=[SDate] And ([VacationDate])<=[EDate]));

In my example: tblVacation is the name of your table; VacationDate is the name of new field; and EmployeeName is the name of the field that has the person's name.

Hope that helps
 
You are da man or woman :D

Thank you very much

Joe
 

Users who are viewing this thread

Back
Top Bottom