BusinessObjects Board

Date range query

Hi all, I have a variable in a crystal report that I’m trying to recreate in webi. It’s to show sales between 8 and 14 days ago. The webi variable below isn’t working, does anyone know the correct syntax to use please?

crystal variable
if {orddeth1.o-date} in currentdate - 8 to currentdate - 14 then {orddeth1.o-sentqty}

webi variable
=If([Delivery Date]<=CurrentDate()) And
([Delivery Date]>=RelativeDate(CurrentDate();-14;DayPeriod)) And
([Delivery Date]>=RelativeDate(CurrentDate();+8;DayPeriod))
Then “Y” Else “N”

There may be a way to get your approach to work. I would recommend a different approach using the DaysBetween() function.

To show my work more clearly I will split this logic that could be one variable into two. First Var Days Between

=DaysBetween(CurrentDate();[Full Date])

Then I use that variable in Var In Date Range

=If([Var Days Between] Between(-14; -8)) Then
“Y”
Else
“N”

Hope that helps.

Noel

2 Likes

Thanks Noel that worked, much appreciated.

1 Like