r/SQL • u/fatandgeared8675309 • May 03 '22
MS SQL Reoccurring query, no hard coding, MS SQL
I am looking for a WHERE clause to set a reoccurring query to be run for the past 2 weeks. No hard coding can be used. Anyone have any ideas?
Have tried “>= getdate() -14 “ and that’s not pulling how I want. Any suggestions help.
1
Upvotes
View all comments
Show parent comment
1
u/fatandgeared8675309 May 03 '22
Some of the data is proprietary so posting it would be…not good for me lol.
However, I need to have a reoccurring query that I can run at any time which will pull every document which has had an attachment added to it in the past 14 days. To the best of my knowledge, each item that has an attachment included is added to a table that exists just to house documents with attachments. We can just call it doc_table for the sake of this