get data in financial year in sql
-
How to get data in financial year(april -march) in stored procedure in sql server 2005?I googled a lot.But didnt find suit answer.Hope you help. :)
-
How to get data in financial year(april -march) in stored procedure in sql server 2005?I googled a lot.But didnt find suit answer.Hope you help. :)
Something like this you mean? Inputparameter is int @fiscalyear.
WHERE (YEAR(yourdatefield) >= @fiscalyear AND MONTH(yourdatefield) >= 4)
AND (YEAR(yourdatefield) <= (@fiscalyear + 1) AND MONTH(yourdatefield) <= 3)Cheers
If you can read this, you don't have Papyrus installed
-
How to get data in financial year(april -march) in stored procedure in sql server 2005?I googled a lot.But didnt find suit answer.Hope you help. :)
Because each company may have a different fiscal year, you need to actually have a strategy to deal with it in your data structure. there are a number of options! Have a function that converts a date to finscalyear/period (2010/01 = April) Actually store the correct fiscal values with the data. Maintian a "Period" table with all the relevant dates and FK it to your data (we use this method)
Never underestimate the power of human stupidity RAH