Hi Experts,
I have some requirements with date. Based on TODAY and YESTERDAY, need to calculate the date variables. Which will be passed as an argument to the database.
If today is Thursday Oct 25, 2007:
Requirements.
Value Maestro parm and meaning
TODAY = today ( today's date )
YESTERDAY = Yesterday .
$YESTERDAY < 1 DAY = day before yesterday
$YESTERDAY < 2 days = 2 days before yesterday (3 days ago)
$YESTERDAY < 6 DAYS = 6 days before yesterday
$YESTERDAY < 7 DAYS = 7 days before yesterday
$YESTERDAY < 20 DAYS = 20 days before yesterday
$YESTERDAY < 30 DAYS = 30 days before yesterday
$YESTERDAY < 60 DAYS = 60 days before yesterday
$YESTERDAY < 90 DAYS = 90 days before yesterday
$YESTERDAY < NEAREST FIRSTDAY = the nearest first day of month before yesterday
$TODAY < 1 MONTH < NEAREST FIRSTDAY = the nearest first day of the month before 1 month ago
$YESTERDAY < 6 MONTH < NEAREST FIRSTDAY = the nearest first day of the month before 6 months ago
$YESTERDAY < 12 MONTH < NEAREST FIRSTDAY = the nearest first day of the month before 1 year ago
$YESTERDAY < 24 MONTH < NEAREST FIRSTDAY = the nearest first day of the month before 2 years ago
$TODAY < NEAREST LASTDAY = the nearest last day of the month before today
$TODAY < 1 MONTH < NEAREST LASTDAY = the nearest last day of the month before 1 month ago
$TODAY < 1 MONTH > NEAREST LASTDAY = the nearest last day of the month after 1 month ago
$YESTERDAY > 14 DAYS = 14 days forward from yesterday
Is there any better way to write a script or function to archive this.
Regards,
Sridhara.