[AccessD] weekdays and numbers

Pedro Janssen pedro at plex.nl
Fri Aug 15 12:00:15 CDT 2008


Hello Gustav, Doris, Mark and others,

i also thought that in previous expressions i used weekday before. So i looked it up but couldn't find it in the normal help. That's why i asked at accessd. So i will take Marks tip for the vba help in mind. 

Also i thought that first day of the week was optional, but without it:    Weekday([YourDateField]) In (1, 5) i get no result. With the ",2" it works perfect.

Thanks

Pedro









Hi Pedro

The "2" determines which day is read as the first day of the week. Look up the on-line help for full explanation.
2 stands for Monday which is used in most (if not all) of Europe.

As Doris writes, Month is first choice to extract the month of a date. However, it returns an Integer and as you request a leading zero, you need a string, and Format would then be the choice:

  Format([YourDateField], "mm")

/gustav

>>> pedro at plex.nl 15-08-2008 11:10 >>>
Hello Gustav,

i used Weekday in the expression (before i asked at accessd), without the ", 2" after my fielddate, but became no result. With the ", 2" i worked fine. Why?

Can i also get the month in an extra field with one expression?
The result then must be:

Date               Month
04-05-2008         05
04-05-2008         05
11-07-2008         07


Thanks

Pedro






Hi Pedro

You could filter on: 

  Where Weekday([YourDateField], 2) In (1, 5)

and count records.

If you only wish to count distinct dates, you can create a Select Distinct query first and feed that to the query where you count.

/gustav



>>> pedro at plex.nl 14-08-2008 13:09 >>>
Hello Group,

i have a list of dates and i need to now how many dates are on friday or monday.
The dates kan be present more then ones (notation is: dd-mm-yyyy).

How can i calculate this?

Thanks

Pedro Janssen




More information about the AccessD mailing list