View Single Post
  #3  
Old May 11th, 2010, 04:03 AM posted to microsoft.public.access.queries
PieterLinden via AccessMonster.com
external usenet poster
 
Posts: 307
Default start date & end date - show all date in between

Nancy Tang wrote:
I have a date table & a leave table which leave table contains startdate &
end_date. How i do show all date in between startdate & end date . For
example : Leave startdate = 1/5/2010, end date =3/5/2010. i want the data
show all date - 1/5/2010 NANCY AL
2/5/2010 NANCY AL
3/5/2010 NANCY AL



SELECT Leave.PersonID, Leave.LeaveStart, Leave.LeaveEnd, TableOfDates.TheDate
FROM TableOfDates, Leave
WHERE (((TableOfDates.TheDate) Between [Leave].[LeaveStart] And [Leave].
[LeaveEnd]));

You don't really need the Leave.LeaveStart and Leave.LeaveEnd fields in there.
.. I just put them in to make sure my math was right... Note that there is
NO join between the two tables... that's deliberate. Basically, I'm creating
a deliberate Cartesian product and then filtering it with the Where clause.

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...eries/201005/1