Results 1 to 3 of 3
  1. #1
    Azyrus is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    9

    Week Totals

    Hey Guys its me again =P

    My database is coming along very nicely thanks to the help of some great people in this forum.



    My latest challenge...

    I have three tables, one for "Jobs" one for "Plumbers who work on a job" and one as a "unique plumber list".

    I want to create a total of each week in my report at the moment the report shows all the jobs, and each day, each job has a job cost and at the bottom of the day is a day total. What I need now is a week total and further on a month and year total.

    Can anyone shed some light on how to create a weekly total expression.

    Thanks!

  2. #2
    apr pillai's Avatar
    apr pillai is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2010
    Location
    Alappuzha, India
    Posts
    209

    Week Totals

    Create a Report Query with the Table and create three new Columns (for week, month and Year) with the following expressions:

    1. DatePart("ww",[WorkedDate],1)

    There are 53 Weeks in a Year. Each date in a Year falls within a week's period. For example 8th Jan, 2011 returns 2 with the above expression. Dates from 8 to 14 Jan will return the value 2 only. Dec. 25 to Dec. 31 falls within the week 53 and any date within this period will return the value 53. If you use this column on the Report and include in the Sorting and Grouping, you can simply write the expression =Sum([JobCost]) in the Group Footer to get the weekly Total.

    The same method can be used for Monthly and Yearly Totals.

    2. DatePart("m",[WorkDate],1) - second column for month values.

    3. DatePart("yyyy",[Workdate,1) - third column for year values.

    The third parameter value 1 indicates that the week day starts on Sunday (this is the default value).

  3. #3
    Azyrus is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    9
    Hello Apr Pillai,

    So thankful for your answer, It worked perfectly!

    Thank you very much.

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

Similar Threads

  1. How to display week of the year
    By wongray in forum Access
    Replies: 2
    Last Post: 12-28-2010, 04:46 AM
  2. week overview
    By FSCHAMP in forum Programming
    Replies: 3
    Last Post: 12-23-2010, 06:23 PM
  3. Finding last week
    By jgelpi16 in forum Queries
    Replies: 5
    Last Post: 09-21-2010, 02:32 PM
  4. Week number wrong
    By Nikki17 in forum Queries
    Replies: 6
    Last Post: 03-18-2006, 10:01 PM
  5. Day of Week Totals
    By ddog171 in forum Queries
    Replies: 1
    Last Post: 03-18-2006, 07:01 PM

Tags for this Thread

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