M
Mark J
I have the following query in microsoft query,
SELECT v_AnalogHistory.DateTime, v_AnalogHistory.TagName,
v_AnalogHistory.Value, v_AnalogHistory.wwRowCount
FROM Runtime.dbo.v_AnalogHistory v_AnalogHistory
WHERE (v_AnalogHistory.TagName='PS004_Pump1.Daily_Runtime') AND
(v_AnalogHistory.DateTime={ts '2007-01-01 00:00:00'} And
v_AnalogHistory.DateTime<={ts '2007-01-14 23:59:59'}) OR
(v_AnalogHistory.TagName='PS004_Pump2.Daily_Runtime') OR
(v_AnalogHistory.TagName='PS004_Pump1.Daily_Starts') OR
(v_AnalogHistory.TagName='PS004_Pump2.Daily_Starts')
what i would like to do is just grab the last 14 days of data..ie
v_AnalogHistory.DateTime=GetDate()
And v_AnalogHistory.DateTime<=GetDate()-14
is this possiable?
SELECT v_AnalogHistory.DateTime, v_AnalogHistory.TagName,
v_AnalogHistory.Value, v_AnalogHistory.wwRowCount
FROM Runtime.dbo.v_AnalogHistory v_AnalogHistory
WHERE (v_AnalogHistory.TagName='PS004_Pump1.Daily_Runtime') AND
(v_AnalogHistory.DateTime={ts '2007-01-01 00:00:00'} And
v_AnalogHistory.DateTime<={ts '2007-01-14 23:59:59'}) OR
(v_AnalogHistory.TagName='PS004_Pump2.Daily_Runtime') OR
(v_AnalogHistory.TagName='PS004_Pump1.Daily_Starts') OR
(v_AnalogHistory.TagName='PS004_Pump2.Daily_Starts')
what i would like to do is just grab the last 14 days of data..ie
v_AnalogHistory.DateTime=GetDate()
And v_AnalogHistory.DateTime<=GetDate()-14
is this possiable?