Entering Dates

Neil_Pattison

Registered User.
Local time
Today, 19:55
Joined
Aug 24, 2005
Messages
73
I need to create a query so that I can run a report that will show records entered between certain dates. For instance lets say

tblTMS has fields IDNo, DateReceived, Name, Address

tblWeeks has fields StartDate, EndDate, WeekNo

(all dates are in the format dd/mm/yyyy).

I want the user to be able to enter a date (possibly by a popup txtbox when trying to run the report)and for it find what week number it relates to in tblWeeks and also what records from tblTMS has entries in the TblTMS.DateReceived between the tblWeeks.StartDate and tblWeeks.EndDate of that particular week.

So the output of the query so show records in the following order.

tblWeeks.WeekNo
tblTMS.IDNo
tblTMS.Name
tblTMS.Address

I've been trying to do this but for some reason can't figure it out. I have done this kind of thing before but now can't get my head around it.

Any help would be greatly appreciated
 
Try this query.

SELECT tblWeeks.WeekNo, tblTMS.IDNo, tblTMS.Name, tblTMS.Address
FROM tblTMS, tblWeeks
WHERE tblTMS.DateReceived Between tblWeeks.StartDate And tblWeeks.EndDate And [Enter a date] Between tblWeeks.StartDate And tblWeeks.EndDate;

^
 

Users who are viewing this thread

Back
Top Bottom