Week out of date?

  • Thread starter Thread starter Harmannus
  • Start date Start date
H

Harmannus

Hallo,

I have a date field (named [Date]) and i want to group the dates of the same
week? Can this be done?

I know there is a month([Date]) and year([Date]) function. But i cannot find
information about generating a week....

Thanx for any tips.


Regards,

Harmannus
 
Harmannus said:
Hallo,

I have a date field (named [Date]) and i want to group the dates of
the same week? Can this be done?

It's not a good idea to name a field "Date", or any other reserved word,
but we can still make this work.
I know there is a month([Date]) and year([Date]) function. But i
cannot find information about generating a week....

GROUP BY DatePart("ww", [Date])
 
Thanx for the tip! This will help me a lot!


Regards,
Harmannus



--
Met vriendelijke groet,

Harmannus
Dirk Goldgar said:
Harmannus said:
Hallo,

I have a date field (named [Date]) and i want to group the dates of
the same week? Can this be done?

It's not a good idea to name a field "Date", or any other reserved word,
but we can still make this work.
I know there is a month([Date]) and year([Date]) function. But i
cannot find information about generating a week....

GROUP BY DatePart("ww", [Date])

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
Hallo,

I have a date field (named [Date]) and i want to group the dates of the same
week? Can this be done?

I know there is a month([Date]) and year([Date]) function. But i cannot find
information about generating a week....

DatePart("ww", [Date])

will return an integer 1 to 54. There are some options for defining
what day starts the week and how the first week of the year is
defined; see the online help for Datepart from the VBA editor.
 
Back
Top