using a Query to find X number of records after a specific DATE

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table of data that contains a record for each BUSINESS day
(Monday-Friday) of the year. The table/date does not contain any records for
non-business days. I want to allow a user to specify the "Start Date" in
which to BEGIN selecting records and have access generate/output all records
matching the "Start Date" plus the 15 records PRIOR to the record associated
with that "Start Date".

For example, suppose the user entered May 5th. I would like an access query
to produce the records for May 5th PLUS the previous 15 records (business
days) within the table/data.

Please help! Thanks
 
Perhaps something like the following would work for you.

One alternative would be to use the Top operator(?).

SELECT Top 16 YourTable.*
FROM YourTable
WHERE TheDateField <= CDate([Start Date])
ORDER BY TheDateField Desc
 

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

Back
Top