SOLVED
Date issue
Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
BBaes
5 - Atom
‎03-03-2021
10:37 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I am connecting to a data base and want the Data pull to always start on the previous Monday. The expression is called return_date and I cant get any criteria to work. Any suggestions?
Solved! Go to Solution.
Labels:
- Labels:
- User Management
1 REPLY 1
jamielaird
14 - Magnetar
‎03-04-2021
02:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @BBaes
In Microsoft SQL Server, you could use the following query to select all records from a table from the previous Monday onwards.
select *
from my_table
where my_date >= dateadd(week,datediff(week,0,getdate()),0);
The exact syntax will depend on the type of database you are using.
I've created an example in SQL Fiddle that you can use to explore the query or adapt it for a different flavour of SQL.
http://sqlfiddle.com/#!18/39c01/6