G
Guest
I read the below question and the answer but I still do not understand how
you got to what you wanted. I'm new to the expressions and the select. can
you please explain more to me on how you set up your query and where you put
this information in. for the expression, can you tell give me an example of
what you did for your query, type, fields, expression. etc. any help would
be appreciated.
Shannon
You'll need an auxiliary table with one record for each date which
might potentially be within the ranges you'll use. I'd suggest opening
Excel and using its spiffy "fill down" feature to create a spreadsheet
with dates from today through, say, the end of 2015. Import this
spreadsheet into a new table (AllDates let's say) in Access. Don't
name the field Date, that's a reserved word - I'll use TheDate as an
example.
You can then use a "non equi join" query:
SELECT PersonName, Alldates.TheDate
FROM yourtable INNER JOIN Alldates
ON yourtable.StartDate <= AllDates.TheDate
AND yourtable.EndDate >= AllDates.TheDate;
Please help if u can
you got to what you wanted. I'm new to the expressions and the select. can
you please explain more to me on how you set up your query and where you put
this information in. for the expression, can you tell give me an example of
what you did for your query, type, fields, expression. etc. any help would
be appreciated.
Shannon
Answer:I have two fields concerning dates. One is the start date, the other is the
end date. I am running a query to gather all people who have requested an
appointment but have not been assigned. They request any time between the
dates specified in those two fields.
How (if possible) can I create a result in the query for each date within
the specified range for each individual.
For example.
John Doe 7-19-2005 through 7-21-2005
will return results:
John Doe 7-19-2005
John Doe 7-20-2005
John Doe 7-21-2005
You'll need an auxiliary table with one record for each date which
might potentially be within the ranges you'll use. I'd suggest opening
Excel and using its spiffy "fill down" feature to create a spreadsheet
with dates from today through, say, the end of 2015. Import this
spreadsheet into a new table (AllDates let's say) in Access. Don't
name the field Date, that's a reserved word - I'll use TheDate as an
example.
You can then use a "non equi join" query:
SELECT PersonName, Alldates.TheDate
FROM yourtable INNER JOIN Alldates
ON yourtable.StartDate <= AllDates.TheDate
AND yourtable.EndDate >= AllDates.TheDate;
Please help if u can