Skip to Content
author's profile photo
Former Member

Difference between Dates: BW Query???

Hello all,

A.I have to get the difference between dates i.e Date1 and Date2.

I have used a 2 formula variables for each one of them with Replacement path - Key - number as the settings.

When i execute the difference between the 2 formula variables, i get inconsistent results if the dates are from 2 different months.

Example(Correct Result)

Date1 = 14.02.2005

Date2 = 10.02.2005

Result = 4

Example(Incorrect Result)???????

Date1 = 14.02.2005

Date2 = 10.01.2005

Result = 104

Iam know that system is converting the date as a number like 20040214 and 22040110 and just substracts.....This is not correct....any solution to circmvent this problem???

B.If iam using a user-exit for variables, how to pass the values Date1 and Date2 to user-exit so that i can calculate the difference of days using a function module.

I know how to use a user-exit but not sure about working on 2 fields at a time for a formula variable????

Add comment
10|10000 characters needed characters exceeded

1 Answer

  • author's profile photo
    Former Member
    Posted on Feb 14, 2005 at 09:37 AM

    1) For the first problem, I think you should play with the replacement path settings (type, offset,...). I did this before and I'm sure it worked.

    2) If the variables are entered in the variable screen there is no problem to use a function module (it works with steps --> look at the how-to), but I think you want to calculate not on variables but on the keyfigure values itself, in this case you will have to use virtual characteristics. There is also a how-to about this, I can't help you with the details my self.

    kr,

    Tom

    Add comment
    10|10000 characters needed characters exceeded