Thanks Thanks:  0
Likes Likes:  0
Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: Determine Fiscal Year (FY) Quarter Based on Dates

  1. #1
    Board Regular
    Join Date
    Jun 2014
    Posts
    1,039
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Determine Fiscal Year (FY) Quarter Based on Dates

    I have a MS Access table where one column has dates i.e. 12/1/12, 7/15/14 and another column where I need the quarter for each date. The quarters are based on the following months:

    Q1 = 10,11,12
    Q2 = 1,2,3
    Q3 = 4,5,6
    Q4 = 7,8,9

    Is there a formula that I can put in the Validation Rule (under the Field Properties) or something to have this field be automatically determined? If not, will it only work in a query?? Is there a VBA for this?

  2. #2
    Board Regular
    Join Date
    Jun 2014
    Posts
    1,039
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Determine Fiscal Year (FY) Quarter Based on Dates

    I guess since the Table is the source data, I would like to ideally have the quarter determined in the Form section.

  3. #3
    Board Regular
    Join Date
    Jun 2014
    Posts
    1,039
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Determine Fiscal Year (FY) Quarter Based on Dates

    **bump**

  4. #4
    MrExcel MVP
    Moderator
    Joe4's Avatar
    Join Date
    Aug 2002
    Posts
    47,923
    Post Thanks / Like
    Mentioned
    40 Post(s)
    Tagged
    8 Thread(s)

    Default Re: Determine Fiscal Year (FY) Quarter Based on Dates

    You can use the DATEADD and DATEPART functions to return the quarter number for your scenario like this:
    Code:
    Qtr: DatePart("q",DateAdd("m",3,[MyDate]))
    Details on DATEADD: DateAdd Function - Access
    Details on DATEPART: MS Access: DatePart Function
    TIPS FOR FINDING EXCEL SOLUTIONS
    1. Use the built-in Help that comes with Excel/Access
    2. Use the Search functionality on this board
    3. A lot of VBA code can be acquired by using the Macro Recorder.

    "Give a man a fish, feed him for a day. Teach a man to fish, feed him for life!"

  5. #5
    Board Regular
    Join Date
    Jun 2014
    Posts
    1,039
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Determine Fiscal Year (FY) Quarter Based on Dates

    Where would I need to put this code in? Under Validation Rule in my Table? In my Form?

  6. #6
    Board Regular
    Join Date
    Jun 2014
    Posts
    1,039
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Determine Fiscal Year (FY) Quarter Based on Dates

    **delete***

  7. #7
    Board Regular
    Join Date
    Jun 2014
    Posts
    1,039
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Determine Fiscal Year (FY) Quarter Based on Dates

    Quote Originally Posted by Joe4 View Post
    You can use the DATEADD and DATEPART functions to return the quarter number for your scenario like this:
    Code:
    Qtr: DatePart("q",DateAdd("m",3,[MyDate]))
    Details on DATEADD: DateAdd Function - Access
    Details on DATEPART: MS Access: DatePart Function
    In addition to my question above, for the syntax [MyDate] I would need to replace it with the name of the column for my field (Date_of_Award)? Correct?
    Last edited by legalhustler; Jul 7th, 2014 at 12:02 PM.

  8. #8
    MrExcel MVP
    Moderator
    Joe4's Avatar
    Join Date
    Aug 2002
    Posts
    47,923
    Post Thanks / Like
    Mentioned
    40 Post(s)
    Tagged
    8 Thread(s)

    Default Re: Determine Fiscal Year (FY) Quarter Based on Dates

    In addition to my question above, for the syntax [MyDate] I would need to replace it with the name of the column for my field (Date_of_Award)? Correct?
    Exactly!
    TIPS FOR FINDING EXCEL SOLUTIONS
    1. Use the built-in Help that comes with Excel/Access
    2. Use the Search functionality on this board
    3. A lot of VBA code can be acquired by using the Macro Recorder.

    "Give a man a fish, feed him for a day. Teach a man to fish, feed him for life!"

  9. #9
    Board Regular
    Join Date
    Jun 2014
    Posts
    1,039
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Determine Fiscal Year (FY) Quarter Based on Dates

    Quote Originally Posted by Joe4 View Post
    Exactly!
    Where would I need to put the code though? In a query? Table? Form? Please be specific.

    Thanks!

  10. #10
    MrExcel MVP
    Moderator
    Joe4's Avatar
    Join Date
    Aug 2002
    Posts
    47,923
    Post Thanks / Like
    Mentioned
    40 Post(s)
    Tagged
    8 Thread(s)

    Default Re: Determine Fiscal Year (FY) Quarter Based on Dates

    Where you put it really depends on how you need/plan to use it.
    The formula I wrote could be inserted into a query as a Calculated Field (also known as an Expression).
    See here for step-by-step instructions on how to do that: Access Tips: Calculating in Queries
    TIPS FOR FINDING EXCEL SOLUTIONS
    1. Use the built-in Help that comes with Excel/Access
    2. Use the Search functionality on this board
    3. A lot of VBA code can be acquired by using the Macro Recorder.

    "Give a man a fish, feed him for a day. Teach a man to fish, feed him for life!"

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •