Results 1 to 4 of 4
  1. #1
    euphonium01 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Posts
    40

    Question Month of Quarter in a Query

    I am having a problem trying to generate the Month of a given Quarter, I am attempting this within a Query, I have the following:



    MonthOfQuarter: (Month([Order Date]) Mod 3)

    This seems to work well for the first two months of each quarter, but always returns 0 (zero) for the third month. Can anyone help as to where I'm going wrong?

    Thanks in advance

  2. #2
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    Mathematically, that's what mod means. You should get what you want from

    MonthOfQuarter: ( (Month([Order Date]) -1) Mod 3) + 1

    or from

    MonthOfQuarter: IIF( (Month([Order Date]) Mod 3 = 0), 3, Month([Order Date]) Mod 3)

    Both of those formulae will give you (1, 2, 3) rather than (1, 2, 0).

  3. #3
    euphonium01 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Posts
    40
    Thanks so much, used the first option you sent me, worked first time

    Very much appreciated

  4. #4
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    No prob. Please mark the thread "solved". Top of page, under "Thread tools".

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

Similar Threads

  1. Replies: 25
    Last Post: 11-16-2012, 12:47 PM
  2. Display previous quarter data when quarter is selected
    By rlsublime in forum Programming
    Replies: 1
    Last Post: 07-03-2012, 03:12 PM
  3. Show Year with Quarter
    By Mordred in forum Access
    Replies: 9
    Last Post: 06-30-2011, 07:50 AM
  4. Replies: 23
    Last Post: 06-30-2010, 02:05 PM
  5. Sum bookings by quarter
    By kgav1 in forum Access
    Replies: 3
    Last Post: 04-14-2010, 08: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