Forum Discussion

qazwsxedc's avatar
qazwsxedc
Helper III
5 years ago
Solved

Reference a date in another query

I have several sql queries that need to delare a date, e.g. Declare @date1 datetime ='31july2020'

Instead of changing the date for all the queries each month, I  want to link it to another query "Date" so that every month I only need to update the date in the "Date" query, then all other queries' date will be updated. Thanks!

5 Replies