DatePart Help Quarter AND Year

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • anoble1
    New Member
    • Jul 2008
    • 246

    #1

    DatePart Help Quarter AND Year

    I am making an Access report that will show the quarter of something took place and the year it took place based on the date.

    Right now i have it to where it just shows the quarter. I can't figure out how to show the year and quarter.

    Here is what I have...
    Code:
    Expr1: DatePart("q",[MeetingDate])
    So, it just throws the quarter out there and I have multiple years. Can someone show me how to throw year in there as well?

    Thanks
  • ADezii
    Recognized Expert Expert
    • Apr 2006
    • 8834

    #2
    Originally posted by anoble1
    I am making an Access report that will show the quarter of something took place and the year it took place based on the date.

    Right now i have it to where it just shows the quarter. I can't figure out how to show the year and quarter.

    Here is what I have...
    Code:
    Expr1: DatePart("q",[MeetingDate])
    So, it just throws the quarter out there and I have multiple years. Can someone show me how to throw year in there as well?

    Thanks
    Code:
    Year_and_Quarter: Format([MeetingDate],"yyyy") & " - " & DatePart("q",[MeetingDate])

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32669

      #3
      Or more simply :
      Code:
      Year_and_Quarter: Format([MeetingDate],'yyyy - q')

      Comment

      • ADezii
        Recognized Expert Expert
        • Apr 2006
        • 8834

        #4
        Originally posted by NeoPa
        Or more simply :
        Code:
        Year_and_Quarter: Format([MeetingDate],'yyyy - q')
        Definitely more simple! (LOL)

        Comment

        • anoble1
          New Member
          • Jul 2008
          • 246

          #5
          Thanks as always NeoPa, and ADezii.
          It works great!

          Comment

          • NeoPa
            Recognized Expert Moderator MVP
            • Oct 2006
            • 32669

            #6
            I know I can speak for ADezii on this one...

            It's a pleasure to help :)

            Comment

            Working...