Results 1 to 4 of 4
  1. #1
    Schon731 is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    19

    Weekly reporting comparisons in query

    Is there a way to select a week at a time from a date field? I would like to pull out say the 25th week of the year and then do another query that pulls the 24th week and them compare the 2 for sales, etc. I tried with DatePart but that didnt seem to work for me.. Thanks

  2. #2
    HiTechCoach's Avatar
    HiTechCoach is offline MS MVP - Access Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Jul 2010
    Location
    Oklahoma, USA
    Posts
    702
    Welcome to Accessforums.net!

    Try using the Format() function like this:

    Format([YourdateField], "ww",vbMonday)


    Example:
    Code:
    ? Format(#9/1/2010#, "ww",vbMonday)
    36

  3. #3
    Schon731 is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    19
    Do I enter this into the "format" section under properties for the field in the querry or do I go to the "criteria" section and build it there?

  4. #4
    slave138's Avatar
    slave138 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Oct 2010
    Location
    WI
    Posts
    233
    You can return all records for a certain week using this for the date field's criteria:
    Code:
    DatePart("ww",[tblTable].[RecDate])=DatePart("ww",Date())
    This would give you the results for this week but you can replace the Date() function with any other date source for a different week.

    Use it in a query to get the sum of a value (see sample)

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Excel Import/Append Data (weekly)
    By MartinL in forum Import/Export Data
    Replies: 1
    Last Post: 08-12-2010, 06:14 PM
  2. Weekly calculation query?
    By katie_88 in forum Queries
    Replies: 1
    Last Post: 07-13-2010, 10:54 AM
  3. Reporting counts in another query...maybe?
    By Geewaagh in forum Queries
    Replies: 7
    Last Post: 06-04-2010, 07:39 PM
  4. weekly total
    By nkuebelbeck in forum Queries
    Replies: 2
    Last Post: 03-24-2010, 02:59 PM
  5. Grouping from several comparisons
    By piflechien73 in forum Queries
    Replies: 3
    Last Post: 05-26-2009, 04:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums