LLBLGen Version 2.6 Final. Adapter Templates.
I have two date fields I want to sort by, a Start Date and an End Date. I want to sort only by the date portion and ignore the time portion. The time portion should not be considered so when two records have the same StartDate date part, they will be sorted by the EndDate.
For Example:
Default behavior - Sort By (StartDate ASC, EndDate ASC)
Id StartDate EndDate
1 Jan 1 2009 1:00PM Mar 1 2009 1:00PM
2 Jan 1 2009 2:00PM Feb 1 2009 1:00PM
Desired Behavior - Sort By (DatePartOnly(StartDate) ASC, EndDate ASC)
Id StartDate EndDate
2 Jan 1 2009 2:00PM Feb 1 2009 1:00PM
1 Jan 1 2009 1:00PM Mar 1 2009 1:00PM
I was able to do this using by applying an Expression in a ResultsetFields and sorting on that field, but this seems a little hackish and requires me to get my results as a list.
Is it possible to do the same thing but more closely to how the "Generated code > Calling a database function > Using a function call in a predicate" example in the documentation works? I tried applying the expression to a field and passing it along with the sorter, but it gets ignored. Or is there another way which I have overlooked?