Solved

Return the last saturday date regardless of when the sql was ran in any given week

Posted on 2015-01-15
1
229 Views
Last Modified: 2015-01-15
Guys, I want to return the date of the last saturday regardless of when the code was ran.

ie today is 15/01/2015 so last saturdays date is 10/01/2015.

I want to run this any day of the week but the result has to be the same so when I run the code next week on say the 20/01/2015 the saturday to be returned is the 17/01/2015

Any Help

Thanks
0
Comment
Question by:DarrenJackson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 

Accepted Solution

by:
DarrenJackson earned 0 total points
ID: 40550989
just worked it out

TRUNC(SYSDATE, 'IW') -2
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
return value in based on value passed 6 48
Oracle Errors 11 81
error doing substr 3 51
TNS timeout - "Error-2147467259 ORA-12170: TNS Connect timeout occurred” 10 70
Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question