Question
DatePart To Select Data at Half Hour Mark
I have a view in SQL server I am selecting from. I am getting
a bunch of timestamped logs. I only want to select the logs at the
half hour mark 1:00, 1:30, 2:00, 2:30 etc. The following code works
fine:
select PointName, [DateTime], PointValue From dbo.ExtendedLog_view
where PointName IN ('R481A_Litestatus', 'R481_Litestatus','R481A_SpaceHum', 'R481_SpaceHum','R481ASpace' ,'R481Space') and [DateTime] > #DateAdd('h',-12, todayDate)# and DatePart("n", [DateTime]) = '00'
I get all the logs timestamped with a minute of 00. If I add another DatePart factor the page processes and just gets stuck there. Adding an additional "or DatePart("n", [DateTime]) = '30'" seems to lock the page up.
Any ideas as to why this might be happening? Is there any other method I can use to only select logs timestamped on the hafl hour mark?
select PointName, [DateTime], PointValue From dbo.ExtendedLog_view
where PointName IN ('R481A_Litestatus', 'R481_Litestatus','R481A_SpaceHum', 'R481_SpaceHum','R481ASpace' ,'R481Space') and [DateTime] > #DateAdd('h',-12, todayDate)# and DatePart("n", [DateTime]) = '00'
I get all the logs timestamped with a minute of 00. If I add another DatePart factor the page processes and just gets stuck there. Adding an additional "or DatePart("n", [DateTime]) = '30'" seems to lock the page up.
Any ideas as to why this might be happening? Is there any other method I can use to only select logs timestamped on the hafl hour mark?
