Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 4729

Sql query to fetch data based on date conditons

$
0
0

Hi All,

We have to schedule a script that runs at 1:00 AM from Monday to Friday.

The script will run a  sql query  ,that will fetch the data from sql database 2008 based on the below conditions.

Case 1: If date = current Date then retrieve the data of the previous Date.

Case 2: If date = Monday then retrieve the entries of Friday ,Saturday and Sunday.

Please help us on how we can achieve this.

Thanks



Viewing all articles
Browse latest Browse all 4729

Trending Articles