Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Looking within date range in subform

Status
Not open for further replies.

mutiger83

IS-IT--Management
Apr 18, 2005
29
US
I have a table setup with a field for [startdate] and [enddate] that specifies a period in which somone is out of the office. I have designed a form where a user will enter a stardate and enddate (unbound) on a form and in the subform it needs to look in the table to see if anyone 'off' during that period of time. The problem I am having is if on the form someone selects 3/1/06 to 3/2/06 in the unbound fileds and in the table someone is off 2/28/06 [startdate] through 3/5/06 [endate], how can I get my subform / query to locate 3/1/06 - 3/2/06 within that date range???

Thanks in advance for your help! =)
 
Something like this (SQL code) ?
WHERE startdate<=[Forms]![name of mainform]![enddate] AND enddate>=[Forms]![name of mainform]![startdate]

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top