Hi,
I want to find fiscal month and year based on a date. How Can I do it using TSQL?
I have SQl server 2008.
Any help?
Regards Manjot
Hi,
I want to find fiscal month and year based on a date. How Can I do it using TSQL?
I have SQl server 2008.
Any help?
Regards Manjot
You should have a table defining your fiscal year, and build queries based on that. Trying to do something tricky in TSQL is only going to give you nightmares.
You store a table of days (one row per day) with date and columns for the fiscal year and month that are pertinent to your org (fiscal month and year vary from org to org).
SQL as a rule is much better at looking up data rather than computing it. A fiscal calendar table for the next century would take a puny amount of data and save tones of cycles in computation.