Dec 07 2021 04:23 AM
Hello,
I do have a problem using the LAG function in a View. I use:
LAG(Process_Time,1) OVER (ORDER BY Process_Time)
Problem is: As soon as I hit the retutn button it delets "OVER (ORDER BY Process_Time)", when I close the view it complains "OVER Clause missing" ???????
I am using Windows 10 and SQLExprss server 2014. The LAG function is rather simple, syntax is correct, why does it ignor the OVER clause???
Any Idea??
Thanks, regards, Peter
Dec 07 2021 05:13 AM
@Peter62270 , by "hitting return button" I guess you use a view design wizard?
The wizards are know for been not reliable and that they don't alway support new SQL features.
Install the lates SSMS version or better use always plain script to create objects.
Dec 07 2021 05:32 AM
Hi Olafhelper,
thanks for your advice. If entered directly as text it works but it is rather slow. I am using Access as a front end I may as well run this table through a little program code and calculate the time diffference, probably it is quicker this way. I will try and compare.
However, your advice was good. Thanks.
Regards
Peter
Dec 07 2021 11:06 PM
@Peter62270 , in MS Access you can use "Pass-Through" queries to pass it directly to SQL Server instead that Access process the query.