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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date lookup to determine fiscal month

Status
Not open for further replies.

ajv

IS-IT--Management
Jul 10, 2001
9
US
I have a call center log with dates. I would like to determine the fiscal month ( which is different from the calendar month ) by checking if the date falls between start of fiscal month date and end of fiscal month date.

Any suggestions?

Thanks.

ajv
 
If the date for the changeover is a constant, you could just do the data math. Otherwise, a table appears to be an acceptable mechanisim.

MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
For us our fiscal year starts in July, so to find out the fiscal month you just need to subtract 6 from the month (which makes July the first month). If you wind up zero or below you add 12. January (1)-6 = -5 +12 = 7. January is our 7th fiscal month.

That's how to calculate the fiscal month.
 
So then I figured, that that might not be all that clear, soooo . . .
you can put this expression in a query:

datepart(&quot;m&quot;,[somedate])-6 + iif(datepart(&quot;m&quot;,[somedate])-6<1,12,0)

substitute your date field's name for the word 'somedate' in both places. And adjust the 6 in both places to correct the fiscal year offset. It should be the number of the month your fiscal year starts less one.

LouieGee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top