Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to get data by default date but not max date

Hello, Friends!

My problem is to get the default date for data selection, but not the max date.

Usually, we can use Max("Date_Filed") to get the max date for today, also current year or month.

But I have a table which has some data in future. That means max date is not today. And I cannot get current year and month via this method.

for example

Date (YYYY-MM-DD)Amount
2018-01-01100
2018-05-01100
2018-06-07100
2018-09-01100

If I use Max("Date (YYYY-MM-DD)"), Then I get date 2018-09-01 which is in future.

What I want is to show data on today (2018-06-07) or to sum from 2018-01-01 to 2018-06-07 and so on.

And with another important point that if I change the date, the data shown is also changed.

If anyone met the situation before?

Thank you very much.

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Get it done by If() + GetSelectedCount()

View solution in original post

5 Replies
Anonymous
Not applicable
Author

Get it done by If() + GetSelectedCount()

bramkn
Partner - Specialist
Partner - Specialist

if(GetSelectedCount(date)>0,max(date),today())?

Anonymous
Not applicable
Author

if(GetSelectedCount(date)<0,today(),max(date))

bramkn
Partner - Specialist
Partner - Specialist

you can never select less than 0?

Anonymous
Not applicable
Author

oh, yes, you are right.

sorry for that.

it is less than 1