Select on Date Variable in a View

In my View, I need to Select ......... WHERE CustReportDT > @60DaysAgo
In stored procedures, I derive the value for @60DaysAgo then do the select but I need
to do the same in a view if possible.

Because a view cannot accept a parameter, do I have to create a UDF?

Thanks for your tips.

> DATEADD(DAY, -60, CAST(GETDATE() AS date))

1 Like

@ScottPletcher your solution is just what I needed and I should have tried it before I posted. Thank you.

No problem. Glad it worked!