×
We value your feedback! Please click here to access our 2024 Client Survey.
The survey will remain open until November 1st. Your perspective will help guide our product/service planning and goals for the upcoming year and beyond!

date/time filtering using +0d?

LabKey Support Forum
date/time filtering using +0d? Ben Bimber  2013-01-24 17:58
Status: Closed
 
labkey supports filtering syntax like:

date~dategte=+0d
or
date~datelte=+1d

which will filter the column date for any date greater than now(), or less than 1 day in the future, respectively. it's a very useful feature.

this syntax only works on the date versions of GTE and LTE. unless i'm wrong, this means we're comparing on the date-portion only, rather than date/time. therefore

date~dategte=+0d

actually means 'any record where the date portion of the datetime value is in the future', rather than truly meaning >=now(). it doesnt look like we support +0d syntax on LTE or GTE. this comes from CompareType.asDate(), which only gets called through the date-specific filters.

It would be nice if CompareType or SimpleFiler could automatically apply that parsing if the column was a date; however, neither of those appear to have any information about the datatype of the column they're bound to. They have a FieldKey only.

It is possible to get +0d syntax, while also filtering on date/time? If not, and I hate to suggest it, but would you consider an additional filter type (something like datetimegte, datetimelte)? i dont love the latter idea, but it isnt that much of an addition.