06-22-2006 9:32 AM
Hi all,
I want to know if a date lies within a given time-frame (marked by end date).
The problem is, that the user can give the check time frame in days, weeks, months or jears.
The calculation is actually similar to the best before date calculation in Material Master.
But how do I calculate with these units.
Greetings Fred
06-27-2006 12:34 PM
Hi Fred!
First you should convert your input into a date or a number of days. Here a case on the input type should help (if type = weeks, then multiply input * 7...)
With the number of days you can calculate your ending date (e.g. end_date = start_date + l_days). Then a simple if p_date > start_date and p_date < end_date. should do the job.
Regards,
Christian
06-27-2006 12:34 PM
Hi Fred!
First you should convert your input into a date or a number of days. Here a case on the input type should help (if type = weeks, then multiply input * 7...)
With the number of days you can calculate your ending date (e.g. end_date = start_date + l_days). Then a simple if p_date > start_date and p_date < end_date. should do the job.
Regards,
Christian