Microsoft Dynamics NAV
uses the datetime
of yyyy-12-31 23:59:59.000
to identify yearly closing entries. I am trying to write a report that will bring all of my entries, except for these. The query works fine for 2014
if I explicitly use a WHERE
clause of
WHERE [Posting Date] <> '2014-12-31 23:59:59.000')
But I need the query to work for any year. I tried:
WHERE (DATEPART(mm, [Posting Date]) <> 12) AND
(DATEPART(dd, [Posting Date]) <> 31) AND
(DATEPART(hh, [Posting Date]) <> 23) AND
(DATEPART(mi, [Posting Date]) <> 59) AND
(DATEPART(ss, [Posting Date]) <> 59)
But that filtered out everything that was in December
or had a day of 31
or an hour of 23
, etc...
Is there a simple way to filter a given datetime, but with any year?