Solved

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

Posted on 2015-01-15
1
215 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
1 Comment
 

Accepted Solution

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

TRUNC(SYSDATE, 'IW') -2
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

744 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now