Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Hi All, I have a query that returs the last 8 hrs worth of data, what I need it to do is return the data from 6am that day SET QUOTED_IDENTIFIER OFFSELECT * FROM OPENQUERY(INSQL, "SELECT DateTime = convert(nvarchar, DateTime, 21), [Line-Status] FROM WideHistory WHERE [Line-Status] IS NOT NULL AND wwRetrievalMode = 'Delta' AND wwVersion = 'Latest' AND DateTime >= DateAdd(hh,-8,GetDate()) AND DateTime <= GetDate()") So I need to replace the -8 with the time diff between 6am and now.ThanksJezz