Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2011
    Location
    Baltimore, MD
    Posts
    22

    Unanswered: Grouping dates in query

    I have a list records that have start and end dates (7/1/1-7/31/11, 8/1/11-8/31/11...). As there are multiple records with the same start and end dates I want to group them in the query but have no clue how to do that.
    Any help would be greatly appreciate!

  2. #2
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    The Query Builder has the "Grouping" functions, which will allow you to group by date.

    However, if the date includes the time, it may not do what you want. A quick and dirty way to accomplish grouping by date is to add an expression to your query the uses the "Format" function to convert the date to something you want to group by.

    For example, if I want to group by week, use this as your field:
    Code:
    GroupByWeek: Format([DateField],"yyyy-ww")
    The format function will convert the date to a string, in this case "2012-12" (for the 12th week of 2012).

    There is lots of help on this and other date handling functions in this forum and on the web. Good luck.
    have fun!

    Todd S.
    click to email


    Independent Development Consultant
    Biz db & reports - SQL, Access, Crystal, Seradex and more
    Small, custom, unique programs - Office, VBA, .NET


    _________________________________________________
    Favorite message from Windows:
    There was an error displaying the previous error message

    Sadly, there was no error number to look up ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •