I have created a complex query that references a specific date (year and month to report on) on numerous parts of the script. What would be the best artifact to have to only change 1 line of code and have that cascade to all my script each time a new reference date is needed?
I understand that there are issues declaring and using a variable in the same query due to complexities in the execution plan. Also I do not have access to the database other than to query so I cannot use Stored Procedures or Functions, and can only depend on client side script.
Any suggestions or guidance would be welcome. To clarify I am not asking for specific code or to review my code (as it is functional) but rather to offer high level guidance on what would be the best solution to the problem presented. Regards,