Date critera - select 20 daily dates and then select one day a week.

  • Thread starter Thread starter dodat
  • Start date Start date
D

dodat

Hi,

I am trying to select the first 20 days of a population of data and then
after that only choose one day out of the week and continue this philosphy
once a new population of dates pop up. Is there a specific query or
conditional statements I can used to create this?

Thanks in advance.
 
Hi,


Not sure I understand, but if you want the records that occur in a period of
20 days starting at a "givenDate", then:


WHERE dateStamp BETWEEN givenDate AND givenDate+20


should do.



Hoping it may help,
Vanderghast, Access MVP
 
How about a WHERE clause that looks something like:

WHERE [DATE_FIELD] < (SELECT MIN([DATE_FIELD]) + 21 FROM [Your_Table])
OR WEEKDAY([DATE_FIELD]) = [Day of Week]

When you run this, it will ask for a [Day of Week] value, enter the number
corresponding to the day of the week you want (1 = Sunday on most systems,
but can be changed as the second parameter in the Weekday() function.

Not quite sure how you are defining a "new population of dates", but this
should answer the first part of the question.

HTH
Dale
 
Back
Top