Home Forums SQL Server 2012 SQL Server 2012 - T-SQL Changing from "hard-coded" to dynamic query RE: Changing from "hard-coded" to dynamic query
momba
SSChasing Mays
Points: 629
More actions
January 25, 2013 at 9:25 am
#1581104
... I came across one last issue. How can I make the " While @loopYrbeg < year ( getdate() )" statement conditional?
More specifically IF month ( getdate() ) < 7
THEN @loopYrbeg < year ( getdate() ) - 1
ELSE @loopYrbeg < year ( getdate() )