[AccessD] weekdays and numbers

Gustav Brock Gustav at cactus.dk
Fri Aug 15 04:50:29 CDT 2008


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