Results 1 to 2 of 2
  1. #1
    aellistechsupport is offline Competent Performer
    Windows 7 32bit Access 2013
    Join Date
    Apr 2014
    Posts
    410

    Sum First, Second, and Third Month of Previous Quarter?

    Hello,
    I can't seem to figure out how to get
    First month of the previous quarter total
    Second and Third


    I have the following but the totals aren't correct UNLESS it's ran in the 1st month of the current quarter for the previous quarter data.


    here are the snippets


    Code:
    Sum(IIf(Month([CheckDate])=Month(Date())-3,[WagesSubjToEmployerUI],0)) AS Mth1, Sum(IIf(Month([CheckDate])=Month(Date())-2,[WagesSubjToEmployerUI],0)) AS Mth2, Sum(IIf(Month([CheckDate])=Month(Date())-1,[WagesSubjToEmployerUI],0)) AS Mth3

    Code:
    HAVING (((Year([CheckDate]))=[Forms]![frmProcessing]![CurrentYear]) AND ((DatePart("q",[CheckDate]))=DatePart("q",Date())-1)

    How/what can be changed so Mth1 is actually the First month of the previous quarter, etc ...?


    Since we're in May and still running Quarter 1 data, the Mth1, Mth2, Mth3 are incorrect now. They were correct when ran last month in April.

  2. #2
    aellistechsupport is offline Competent Performer
    Windows 7 32bit Access 2013
    Join Date
    Apr 2014
    Posts
    410
    I think I found a solution based on this post: https://www.accessforums.net/showthread.php?t=36096

    Code:
    Sum(IIf(((Month([CheckDate])-1) Mod 3)+1=1,[WagesSubjToEmployerUI],0)) AS Mth1, Sum(IIf(((Month([CheckDate])-1) Mod 3)+1=2,[WagesSubjToEmployerUI],0)) AS Mth2, Sum(IIf(((Month([CheckDate])-1) Mod 3)+1=3,[WagesSubjToEmployerUI],0)) AS Mth3

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

Similar Threads

  1. Previous Quarter Reporting Based on CalenderMonth
    By aellistechsupport in forum Queries
    Replies: 3
    Last Post: 10-03-2019, 03:53 AM
  2. Previous/Next Month Button
    By archy321 in forum Programming
    Replies: 11
    Last Post: 12-15-2018, 11:43 PM
  3. Replies: 2
    Last Post: 02-12-2015, 05:14 AM
  4. Month of Quarter in a Query
    By euphonium01 in forum Access
    Replies: 3
    Last Post: 07-01-2013, 09:25 AM
  5. Display previous quarter data when quarter is selected
    By rlsublime in forum Programming
    Replies: 1
    Last Post: 07-03-2012, 03:12 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