Page 1 of 1

Return record closest to today's date

Posted: Tue Jul 07, 2015 4:55 pm
by LiquidGold

I am able to populate a text field with today's date, how can I use that (or store it to a variable?) to query records to return only the record that is closest to today's date? Each client will have dozens of records, and I only want to return the latest of them when picked.


Return record closest to today's date

Posted: Tue Jul 07, 2015 6:12 pm
by Evgene Karachevtsev

Hello!

This link should help:
https://devcenter.appery.io/documenta...


Return record closest to today's date

Posted: Tue Jul 07, 2015 6:27 pm
by LiquidGold

Thank you. I did see this about sorting, but will it not still return every record for a single client? Albeit just in a sorted order? I only want one record back of the several there will be. That's why I was thinking of some sort of 'find next record less than or equal to [today]'. Something along the lines of this: http://stackoverflow.com/questions/73...

Although I'm not sure how/if that can be applied to my case?


Return record closest to today's date

Posted: Wed Jul 08, 2015 5:07 pm
by Evgene Karachevtsev

LiquidGold,

Yes, you may change this query to the one that will fit your needs, but unfortunately custom app logic is outside the scope of standard Appery.io platform support. You may consider purchasing Advisory Pack to get more in-depth help on this question. Here is more information about it: http://appery.io/services/#Advisory_Pack