[FONT=Verdana, Arial, Helvetica][FONT=Verdana, Arial, Helvetica]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 OFF
SELECT * 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. Any one got any ideas?
Thanks
[/FONT][/FONT]
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 OFF
SELECT * 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. Any one got any ideas?
Thanks
[/FONT][/FONT]