load a QWP with data offset to today's date?

LabKey Support Forum (Inactive)
load a QWP with data offset to today's date? Ben Bimber  2010-10-15 09:55
Status: Closed
 
we have queries that return records with dates in the past and dates in the future. is there any good solution to load this query in a QWP with an offset such that the first record with today's date is on the active page? the normal approach of sorting on date doesnt work if your data contains future records. thanks.
 
 
jeckels responded:  2010-10-18 17:34
Hi Ben,

The only idea that comes immediately to mind is to do it in a custom query, where you add a calculated column that looks something like:

ABS(TIMESTAMPDIFF('SQL_TSI_DAY', <DateColumn>, NOW()))

and sort descending on that value.

Thanks,
Josh