Skip to Content
author's profile photo Former Member
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 a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • 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 a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.