Results 1 to 6 of 6
  1. #1
    rbellucci is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Location
    MA, USA
    Posts
    7

    Fiscal Quartly now report **Help**

    Ok stupid question, I have done this before without the now function and it seems to be kicking my butt,

    SELECT IRTSI.EIR_status, Count(IRTSI.EIR_status) AS CountOfAction
    FROM IRTSI
    GROUP BY IRTSI.EIR_status, Year([irtsi].[incident_Date]), DatePart("q",Date())
    HAVING (((Count(IRTSI.EIR_status))>0) AND ((Year([irtsi].[incident_Date]))=Year(Now())) AND ((DatePart("q",Date()))=DatePart("q",Now())))
    ORDER BY IRTSI.EIR_status
    WITH OWNERACCESS OPTION;



    ^current code, I need it to produce fiscal quarters instead of jan-dec



    my fiscal quarters go from Oct 1, till sept. Any ideas?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Shouldn't the expression use Incident_Date, not Date?

    Calculate alternate quarter ID:

    Switch(Month([Incident_Date])<=3,2, Month([Incident_Date])<=6,3, Month([Incident_Date])<=9,4, Month([Incident_Date])<=12,1)
    Last edited by June7; 08-30-2013 at 12:07 PM.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    rbellucci is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Location
    MA, USA
    Posts
    7
    Sorry I've been on leave for the last couple of days, the current code is presenting the user with live current data for the quarter in the form, as far as the switch where would i input that in, i'm getting an syntex error.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Sorry, missing the second paren for each Month function. I have edited the post to correct.

    Use that expression in a query to construct a field.

    Can apply filter and/or sort criteria to that constructed field.
    Last edited by June7; 08-30-2013 at 05:38 PM.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    rbellucci is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Location
    MA, USA
    Posts
    7
    Quote Originally Posted by June7 View Post
    Sorry, missing the second paren for each Month function. I have edited the post to correct.

    Use that expression in a query to construct a field.

    Can apply filter and/or sort criteria to that constructed field.
    Maybe i'm missing something here, sorry once again just got back from leave (Bear season in New England), I adjusted the "date" to incident_date (fixed the issue of reporting to many numbers for the current quarter). as far as switching where should I input that in? I put that at the end of the query and I get numbers counted 3 times, like 33, 33, 33, 33 so replicated data.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Use the Switch expression in place of each DatePart() expression.

    GROUP BY EIR_status, Year([incident_Date]), Switch(Month([Incident_Date])<=3,2, Month([Incident_Date])<=6,3, Month([Incident_Date])<=9,4, Month([Incident_Date])<=12,1) HAVING Count(EIR_status)>0 AND Year([incident_Date])=Year(Now()) AND Switch(Month([Incident_Date])<=3,2, Month([Incident_Date])<=6,3, Month([Incident_Date])<=9,4, Month([Incident_Date])<=12,1) = Switch(Month(Date())<=3,2, Month(Date())<=6,3, Month(Date())<=9,4, Month(Date())<=12,1)
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. New fiscal year dates
    By edieb in forum Programming
    Replies: 2
    Last Post: 05-13-2014, 08:42 AM
  2. Replies: 2
    Last Post: 07-25-2013, 05:18 AM
  3. Replies: 1
    Last Post: 06-21-2013, 12:07 PM
  4. Quartly Queries
    By djclntn in forum Queries
    Replies: 4
    Last Post: 11-16-2011, 07:03 PM
  5. fiscal year
    By RedGoneWILD in forum Programming
    Replies: 4
    Last Post: 08-04-2010, 01:38 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