Hi
I have added on date in an aggregate
There is filter in which i have to filter by from and to date between they were added
How can i achieve this ?
Use a filter like:
(FilterFromDate = NullDateTime() or AddedOnColumn >= FilterFromDate) and (FilterToDate = NullDateTime() or AddedOnColumn <= FilterToDate)
With a filter like this you can select a date or leave it empty (to have no From or To limit)
I am trying to add this filter its throwing error, can u please elaborate a little?
The FilterFromDate and FilterToDate should be your filter variables, in this case both DateTime types.
The AddedOnColumn should be renamed to your actual EntityColumn name.
After these changes, what are the errors you are receiving?
Perhaps provide a sample OML (save module, and add it here as reply)
As I see in your screenshot, your AddedOn column is of type DateTime, therefor filtering should be done with DateTime type filters. However, your filter screenshot shows only dates. Your filters should then use the function DateToDateTime:
The FromDate filter:
FilterFromDate = NullDate() or AddedOnColumn >= DateToDateTime(FilterFromDate)
And the ToDate filter:
FilterToDate = NullDate() or AddedOnColumn < DateToDateTime(AddDays(FilterToDate,1))
Explanation of the AddDays: When you want to have the whole day included in the ToDate filter (23:59:59). As seen in the above filter: It adds one day to the selected ToDate filter, converts that to a full datetime (with 00:00:00 time component) and compares it with the AddedOnColumn.
its not even filtering anything, it giving me empty table, is it necessary to create from and to date as an attribute in the entity
I have used local variables to point this values.
The date filter inputs need to point to the local variables.
Without other screenshots it is difficult to solve this.
Here is a sample OML, maybe you can see anything you can use from it.
Could you provide a (simplified) OML to me that I can view?
Thanks!!!! Its working
This forum post has already been marked as solved.
Please don't try to re-ignite 'old' forum posts.
Just create a new forum post with your new question (with perhaps a link to this forum post as reference).
Quick reference: The correct filter to use also depends on the column datatype you want to filter on and the min/max filter data types (date or datetime). You haven't provided an example OML with your issue, or the data types of your column and filter variables, so I can only guess.
Please create a new forum post, including an OML file with the issue you are having, or screenshots with the data types of the column you want to filter and the filter data types (the min/max variables).
Okay, I am deleting that message. I am using the DateTime datatype.