Home » SQL & PL/SQL » SQL & PL/SQL » Financial week and year problem
Financial week and year problem [message #395340] Wed, 01 April 2009 03:20 Go to next message
mohaninforakle
Messages: 55
Registered: January 2009
Member
Hai,

I have a query that how to get the week no as per financial year starts & ends,Say for example according to financial year the month starts from Apirl to march so the first month is apirl,then
apirl 1 to 7 days is first week.

My command is

to_char(mydate,'WW') This command is i used now to get a week no from particular date.But how to get the week no as per financial starts & end

Please somebody help me,already i posted this query,please am in hurry now.I waiting for yours reply.

[MERGED by LF]

[Updated on: Fri, 03 April 2009 14:43] by Moderator

Report message to a moderator

Re: Financial year based week in oracle [message #395356 is a reply to message #395340] Wed, 01 April 2009 03:40 Go to previous messageGo to next message
cookiemonster
Messages: 13965
Registered: September 2008
Location: Rainy Manchester
Senior Member
Work out the week number of the start of your financial year and subtract.
Re: Financial year based week in oracle [message #395357 is a reply to message #395340] Wed, 01 April 2009 03:43 Go to previous messageGo to next message
rajy_salim
Messages: 204
Registered: January 2008
Location: Beirut - Lebanon
Senior Member
Sorry, you posted the same quetion in another thread and I replied there.

Rajy
financial week problem [message #395687 is a reply to message #395340] Thu, 02 April 2009 04:47 Go to previous messageGo to next message
mohaninforakle
Messages: 55
Registered: January 2009
Member
hai,

again i have a problem of getting a weekno for a particular date that should be as per financial year starts & ends.In financial year its starts on march and ends on april.My problem is i want to schedule meeting for one year that is 53 weeks.Initially i will give a date that will automatically increased by 7 days and will schedule one year. But my weekhas to be counted for a date as per financial months starts & ends.That is march 1 to 7 is a first week and 7 to 8 is a second week and so on.Please help me somebody how to do that please...

Am waiting for your reply.
Re: financial week problem [message #395979 is a reply to message #395687] Fri, 03 April 2009 07:10 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
I think your financial week number should just be
FLOOR((<current_date> - to_date('1-mar-2008','dd-mon-yyyy')+1)/7)
Re: Financial year based week in oracle [message #396032 is a reply to message #395357] Fri, 03 April 2009 10:01 Go to previous message
mohaninforakle
Messages: 55
Registered: January 2009
Member
ya,but its not working..


The problem is the week number shows in negative after 53 weeks like -1,-2,-3 .Please help me on this.
Previous Topic: Problem in uploading file
Next Topic: MULTIPLE DYNAMIC INSERTION
Goto Forum:
  


Current Time: Sat Feb 15 08:26:29 CST 2025