Home » RDBMS Server » Server Administration » Last week first day and end day
Last week first day and end day [message #371202] Thu, 14 September 2000 15:22 Go to next message
mimoni
Messages: 1
Registered: September 2000
Junior Member
Assuming sunday to be the first day of the week, for any given date, what is the sql to find the Last week first date and Last week end date.
Re: Last week first day and end day [message #371203 is a reply to message #371202] Thu, 14 September 2000 16:59 Go to previous messageGo to next message
Vjeko
Messages: 15
Registered: August 2000
Junior Member
This is improvisation, but works fine:

SELECT sysdate-6-to_number(to_char(sysdate,'D')) first_day_last_week,
sysdate-to_number(to_char(sysdate,'D')) last_day_last_week
FROM sys.dual;
Re: Last week first day and end day [message #371246 is a reply to message #371202] Fri, 22 September 2000 12:20 Go to previous message
Suresh
Messages: 189
Registered: December 1998
Senior Member
select next_day(to_date('09/18/2000','mm/dd/yyyy')-14,'sunday'),next_day(to_date('09/18/2000','mm/dd/yyyy')-14,'sunday')+6 from dual
Previous Topic: Re: Standard x Enterprise
Next Topic: Re: Standard x Enterprise
Goto Forum:
  


Current Time: Sat Apr 20 09:14:39 CDT 2024