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?
In MicroStrategy I suggest you to create an additional form "Date" for the attribute you mapped on
tblJournal.DateCreatedand define it asDate(tblJournal.DateCreated), where Date is a MicroStrategy function, and the format is of course date.Then you can define the filter for your cube as DateCreated attribute, Qualify on the form Date, equal to Today (using the dynamic date functionality, the Calendar icon beside the value box).
Otherwise on the SQLServer world you can do this:
as suggested here