Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Which Quarter of the Year is today in?

Status
Not open for further replies.

sgfromny

Technical User
Jan 17, 2003
120
US
When a record is created, I give it a date stamp. I also need to calculate which quarter 1st 2nd 3rd 4th. Any Ideas?
 
You can use this formula:
=IIF(MONTH([YOURFIELD])<4,1,IIF(MONTH([YOURFIELD])<7,2,IIF(MONTH([YOURFIELD])<10,3,IIF(MONTH([YOURFIELD])<13,4))))

where [YourField] is the name of your DateStamp field.

HTH,
Eric
 
Thanks, The built in function worked perfectly!
 
careful though, calendar quarter or fiscal quarter?

especially now, with financial reporting being under scrutiny, c/o Mr Sarbanes and Oxley.

in my case i had to load the company's fiscal calendar into a separate table and lookup the quarter.
 
DatePart(interval,date) For quarters, the interval will equal &quot;q&quot;. This is based on the calendar year. It will return a number: 1, 2, 3 or 4. Intervals also include weeks, &quot;ww&quot;, which returns a number from 1 to 52.

Example: YourDate is 1/23/03. DatePart(&quot;q&quot;,YourDate) will return 1 for 1st quarter.

If your using a fiscal year, calculate what week YourDate is in, then assign it to the fiscal quarter.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top