Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a really strange problem with the InYearToDate function. Given the following situation:
LET vCurrentDate = '31-03-2008 23:59:59';
When I do a sum(Sales) over the year 2008 (jan, feb, mar) I get as result: € 257.203,00 which is right.
When I do a sum(Sales) over the year 2007 (jan, feb, mar) I get as result: € 243.214,00 which is also right.
Next thing I want to do is a YearToDate function to compare with 2007 (jan, feb, mar). To sum 2007 and 2008 sales I use the following syntax:
to sum 2008:
Sum({1} IF(InYearToDate (Date, vCurrentDate , -0), Sales))
to sum 2007:
Sum({1} IF(InYearToDate (Date, vCurrentDate , -0), Sales))
The values I get back from those two functions are:
I really don't know what's going wrong.. any sugestions?
Of course to sum 2007 should be:
Sum({1} IF(InYearToDate (Date, vCurrentDate , -1), Sales)
Stupid mistake..... I forgot a field in my link table which caused the strange values.