cancel
Showing results for 
Search instead for 
Did you mean: 

how to substract or add hours for date variable in webi.

Former Member
0 Kudos

we are using SAP BO 4.0 with Sp6,

We have a requirement to subtract 3 hours from one of the date variable created in Webi report.

we tried with relative date() function but it was throwing an error of invalid data type.

Regards,

srujan

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Swapnil & ankush your suggestions are correct!

Former Member
0 Kudos

You can mark my answer as correct and close the thread.

thanks,
Swapnil

Former Member
0 Kudos

Good to know that helped!

-Ankush

Former Member
0 Kudos

Hi Srujan,

Try this formula on your date field:

=RelativeDate([Date_Field];-3/24)

Converting 3 hours to 3/24 of a day.

-Ankush

Former Member
0 Kudos

What is your back end database?

Please specify the format of your date field.

By the time you can use following formula if you want to add 3 hours to date.

=RelativeDate([Sale Date];0.125)

& use below formula if you want to substract 3 hours

=RelativeDate([Sale Date];-0.125)

where 0.125 = 3/24 (in one day there are 24 hours so if you require to add 3 hours then you can use 3/24 = 0.125)

Thanks,
Swapnil

Former Member
0 Kudos

Hi Swapnil,

yesterday I tried the same before posting here and it dint work for me, but unfortunately today it worked.