MAX Function on datetime

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
robleer
Posts: 285
Joined: Wed Jul 14, 2010 7:01 pm

MAX Function on datetime

Post by robleer »

Hi,
I have a BO with a TimeStamp attribute. Now I want to find the maximum date

Example:

BO1.DateAttr= MAX ListwithDates.Entrydate WHERE ListwithDates.Entrydate <=CURRENT_TIMESTAMP

This does not work and it seems that the MAX function is not working on timestamp attributes? Is there another way to find the latest date of a BO?
Using 8.7 Professional 3025 on MySQL/Windows
joben
Posts: 230
Joined: Wed Nov 06, 2019 9:49 pm
Location: Sweden
Contact:

Re: MAX Function on datetime

Post by joben »

FIND ListwithDates.Entrydate WHERE (ListwithDates.Entrydate<=CURRENT_TIMESTAMP) ORDER BY Entrydate DESC TAKE BEST 1
BO1.DateAttr=ListwithDates.Entrydate
Regards, Joakim

Image
robleer
Posts: 285
Joined: Wed Jul 14, 2010 7:01 pm

Re: MAX Function on datetime

Post by robleer »

Ah yes, thats the best way. Thanks !!
Using 8.7 Professional 3025 on MySQL/Windows
Post Reply