cancel
Showing results for 
Search instead for 
Did you mean: 

Add Days to a Date field

Former Member
0 Kudos

Hi all,

I have the following requirement:

I have a date field 0calday and the user would like to add a specific no.of days to it, like for example 10 or 15 days. Then we use this computed date field in calculations in the query. Could you please help and let me know how we can no.of days to a date field? And also how we can compute no.of days between two date fields?

Regards,

Ashmith Roy

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Ashmith,

When the user enters both date and no. of days, and if you want to calculate no of days from the user entered date I think you can go for an exit where you can use the available function module which calculates the no of days from starting of the month for the given date. Then you can add up the days entered by the user and use another available function module which converts it to the dat format again based on the given days and the old date. I don't remember the function module names but i am sur ethey are available.

If the above thing is made possible then I think getting no of days between two dates is not a problem. Well i hope this will help you.

Former Member
0 Kudos

Hi Avr,

I would like to know whether it is possibele to create a user entry variable, like you say, for the number of days and add this to a date field to get a second date that is stored dynamically. I am going to use this second date field in another computation for no. of days which a different date field.

For example I have a date field ZDATE with value 3/21/2006. I want to add 5 days and get and store that value in a new field ZDATE2. I am going to use this ZDATE2 in some other computations.

Please help.

Ashmith Roy

Former Member
0 Kudos

Hi,

Yes it is possible. It all works in the exit you are writing and call it properly. i hope it will work out.

Former Member
0 Kudos

Hi AVR,

I guess I am still missing something here. See I only have one date field in the data target ZDATE. I need to add another new 'calculated' date field to the query. Is this possible? It is not a KF computation but adding a Characteristic to the query. Should I go the Virtual characteristic route? Please advise.

Thanks,

Ashmith Roy

Former Member
0 Kudos

Hi,

Check if you can do it without touching he data target. I think you need not store the calculated date anywhere but get data based on calculated date. It can be made possible in the exit and by using that properly. try and come with details. Good Luck

Former Member
0 Kudos

For your first question, adding a fixed number of days can be acheived by using variable offsets.

For your second question, difference between to dates can be computed by using a formula. This formula contains difference of two formula variables on the two date fields using replacement path.

Let me know if you need more info, I can walk you through the process.

Former Member
0 Kudos

Venky,

The requirement is that if 0calday has a value, say, 03/20/2006 then the user would add 10 or 15 days to it to get a new field, say, zdate with the values 03/30/2006 or 04/04/2006. Could you please elaborate how we can do this using variable offsets?

I found another topic in this forum detailing how to calculate the no.of days between two dates.

thanks,

Ashmith Roy

Former Member
0 Kudos

Is the 10 or 15 entered by user always same or does it change?