J jvbeats Registered User. Local time Yesterday, 23:27 Joined Jan 23, 2013 Messages 10 Jan 24, 2013 #1 Hi, I am relatively new to Access, I would like to format a date field as a quarter in my query. Not sure how to build the expression. Thank you.
Hi, I am relatively new to Access, I would like to format a date field as a quarter in my query. Not sure how to build the expression. Thank you.
MarkK bit cruncher Local time Yesterday, 20:27 Joined Mar 17, 2004 Messages 8,577 Jan 24, 2013 #2 Hey there, try ... Code: Month(YourDate)\4 + 1 Cheers,
jdraw Super Moderator Staff member Local time Yesterday, 23:27 Joined Jan 23, 2006 Messages 15,573 Jan 24, 2013 #3 You could also use datepart("q",YourDate) returns an integer (I think).
J jvbeats Registered User. Local time Yesterday, 23:27 Joined Jan 23, 2013 Messages 10 Jan 24, 2013 #4 Sorry. I think what works best is Format([mydate],"q")
MarkK bit cruncher Local time Yesterday, 20:27 Joined Mar 17, 2004 Messages 8,577 Jan 25, 2013 #5 Glad to be able to help.
G Galaxiom Super Moderator Staff member Local time Today, 15:27 Joined Jan 20, 2009 Messages 12,887 Jan 25, 2013 #6 jvbeats said: Sorry. I think what works best is Format([mydate],"q") Click to expand... A subtle point that should always be kept in mind. DatePart() returns a Number while Format() returns a String. It doesn't matter with Quarter but it makes a difference if you are sorting the output on Month or Day.
jvbeats said: Sorry. I think what works best is Format([mydate],"q") Click to expand... A subtle point that should always be kept in mind. DatePart() returns a Number while Format() returns a String. It doesn't matter with Quarter but it makes a difference if you are sorting the output on Month or Day.