Pls help.
SQL Server 2005
How to write in a select in a SP something like that:
.....
WHERE
T.CCode='AA'
AND
(
If T.VDate is null or blank
begin year(T.ADate)>year(GETDATE ( ))
end
else if T.VDate is not null or blank
begin year(T.VDate)>year(GETDATE ( ))
end
)
SQL Server 2005
How to write in a select in a SP something like that:
.....
WHERE
T.CCode='AA'
AND
(
If T.VDate is null or blank
begin year(T.ADate)>year(GETDATE ( ))
end
else if T.VDate is not null or blank
begin year(T.VDate)>year(GETDATE ( ))
end
)