I am trying to filter data from Microsoft SQL
in an intelligent cube by today's date.
The format of the date from the database is YYYY-MM-DD HH:MM:SS
.
I want to include all of today's date regardless of the time. This is the filter I have now
(tblJournal.DateCreated > AddDays(CurrentDate(),-1))
AND
(tblJournal.DateCreated < AddDays(CurrentDate(),1))
The problem with this filter is it must include time because if for example I run this filter on the 17th at noon it would include all entries on the 16th past noon until the 18th before noon. How can I change this function to only return results from today's date?
you can get the current date without time like
SELECT CONVERT(datetime, CONVERT(varchar, GETDATE(), 101))
AND
How can I change this function to only return results from today's date?
i think you can do this like
i didn't test the code, hope this will help you... happy coding ;)