SmpTraining
MIS
Hi All,
I am trying to get an SQL WHERE clause to select records for the current finacial year only. Therefore it needs to take the 'sysdate' and, depending on the month, create a query against a date of either
A) my_date >= 01/04/YYYY and my_date <= 31/03/YYYY+1
OR
B) my_date >= 01/04/YYYY-1 and my_date <= 31/03/YYYY
I'm using UK 'DD/MM/YYYY' date formats and case A above should be used if the current month is >= 4, otherwise case B should be used. YYYY is, of course, the sysdate year value.
I hope this makes sense. I have tried various things but am not great at Oracle SQL I'm afraid. Any help would be much appreciated.
Steve Phillips, Crystal Trainer/Consultant
I am trying to get an SQL WHERE clause to select records for the current finacial year only. Therefore it needs to take the 'sysdate' and, depending on the month, create a query against a date of either
A) my_date >= 01/04/YYYY and my_date <= 31/03/YYYY+1
OR
B) my_date >= 01/04/YYYY-1 and my_date <= 31/03/YYYY
I'm using UK 'DD/MM/YYYY' date formats and case A above should be used if the current month is >= 4, otherwise case B should be used. YYYY is, of course, the sysdate year value.
I hope this makes sense. I have tried various things but am not great at Oracle SQL I'm afraid. Any help would be much appreciated.
Steve Phillips, Crystal Trainer/Consultant