Home Forums SQL Server 2012 SQL Server 2012 - T-SQL Rewrite the statement RE: Rewrite the statement
Sergiy
SSC Guru
Points: 110207
More actions
February 9, 2016 at 6:42 am
#1857364
Select @day = max(day1)
FROM table1
WHERE date1 = ISNULL( @date, (SELECT max(date1) from table1))
_____________Code for TallyGenerator