Writing a Query based on Day of Week

  • Thread starter Thread starter Alan Balthrop
  • Start date Start date
A

Alan Balthrop

Is it possible to write a query that looks for data on a specific day
of the week? I assume I would need to have the date in "long format"
(ie. Sun, February 29, 2004).

The query I want to write is what is a soccer team's won-loss record
on a paticular day of the week. Is Access 2K2 smart enough to know
that 2/29/2004 is a Sunday without it seeing "Sunday" in the field?



Alan Balthrop
 
Is it possible to write a query that looks for data on a specific day
of the week?
Yes

I assume I would need to have the date in "long format"
(ie. Sun, February 29, 2004).

No, this is not necessary; it is simply a format of the real date that
Access stores as a number which equals the number of days since Dec 30 1899.
Is Access 2K2 smart enough to know
that 2/29/2004 is a Sunday without it seeing "Sunday" in the field?

Yes. Access has numerous functions for working with Date types. In VBA
Help, you can get a list of them by typing:

Date Functions

in the Answer Wizard.

The function that you might find appropriate to your query needs is likely
the Weekday() function.


hth,
 
Is it possible to write a query that looks for data on a specific day
of the week?
Yes

I assume I would need to have the date in "long format"
(ie. Sun, February 29, 2004).

No, this is not necessary; it is simply a format of the real date that
Access stores as a number which equals the number of days since Dec 30 1899.
Is Access 2K2 smart enough to know
that 2/29/2004 is a Sunday without it seeing "Sunday" in the field?

Yes. Access has numerous functions for working with Date types. In VBA
Help, you can get a list of them by typing:

Date Functions

in the Answer Wizard.

The function that you might find appropriate to your query needs is likely
the Weekday() function.


hth,
 
Back
Top