Dilaksha Attanayake
06/22/2023, 11:34 AMSELECT DATETIME_DIFF(THIS,Date (Customer Start),MONTH)
Unexpected 'D'. Expecting: RUNFUNCNAME, IFNULL, FUNCNAME1, ELEM_IDENTIFIER, PREVIOUS, THIS, ZERO, TEXT_ELEM, FUNCNAMEN, IF, REPORT, REAL, FUNCNAME12, OBJECT, COUNT, STRING, NEXT, FUNCNAME2, NATURAL, -, IDENTIFIER, SHORT_STRING, CASE, PERCENTILE, RANKFUNCNAME, (
Francisco Antunes
06/22/2023, 12:04 PMDilaksha Attanayake
06/22/2023, 12:18 PMFrancisco Antunes
06/22/2023, 12:26 PMMonth (Date)
. It will be calculated using months and will give you the result in months too 🙂Dilaksha Attanayake
06/22/2023, 12:34 PMdate1
and date2
where date2
is today, so I can use THIS
for date2
What I want to know is how many months between these two dates
THIS - date1
= x
days
I want this x
to be converted into months
I can't use MONTH(x
) because x
is not a date
I can do MONTH(THIS) - MONTH(date1) but that is not what I want
could you see the problem?Francisco Antunes
06/22/2023, 12:41 PM[<30]Less than 1 Month;
[<60]1 month;
[<90]2 months;
[<120]3 months
In this example, the result in days will be formatted according to the conditions above, so:
1. If the value is smaller than 30, it displays “Less than 1 month”;
2. If the value is Equal or larger than 30, but smaller than 60, it displays “1 month”
and so on
How does that sound?Dilaksha Attanayake
06/22/2023, 1:17 PM