query to work out dates

S

Steven Scaife

I am using the calendar control and can get the date value into a variable.
From this i am going to use it in a query.

What i want to do is take the value that they give me and then work out if
it is between 2 dates.

In my table when a record is created, it logs the date a manual leaves the
shelf and the date that it is due to be returned. How can i get it to take
the variable and then check that it falls between the end date and start
date.

eg.

date leaves: 01/07/03 dd/mm/yy
date returned: 06/07/03
date selected on calender control: 04/07/03

TIA for your time and any help offered.
 
M

Michel Walsh

Hi,


You can't send a variable to a query, directly, but you can put the content of the variable into a
control of an open form (may be invisible, but open) and refer,in the query, to that control,
through the notation

FORMS!FormNameHere!ControlNameHere

like in

WHERE FORMS!form1!Text0 BETWEEN Leaves AND Returned



Hoping it may help,
Vanderghast, Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top