k chandra reddy
30th September 2013, 10:41
How to convert month(suppose 10 months) to date(1234567890).
ex: (tdsls401.dldt+qmvel112.peri)> date

tdsls401.dldt = tcdate
qmvel112.peri = months
date = tcdate

Thanks

vahdani
30th September 2013, 11:49
Hi,

the simple way if you take month as always 30 days:
(tdsls401.dldt+ (qmvel112.peri*30*24*3600)) > date

Otherwise - if you want the day to be the same number (for example 15 decebmer + 1 month = 30 January) - then you have to do it the hard way: Write your own function using first utc.to.date() then add month adjust year and month if month > 12 and then convert back to utc using date.to.utc().

k chandra reddy
30th September 2013, 12:32
Hi,
As you have given the logic,we have implemented but it is showing three days more than shipment date while adding.
Ex: x = tdsls401.dldt + (qmvel112.peri*30*24*3600)) > date.Its is showng more than three days in the report.
we have written like this:
x=tdsls401.dldt +qmvel112.peri*365/12
utc.add(tdsls401.dldt,0,0,x,0,0,0,warrdt)

Regards,
Sasank N C

vahdani
30th September 2013, 13:06
I had forgotten about utc.add()!

the following is the correct way to use this for your case:

domain tcdate new.date
long ret

ret = utc.add(tdsls401.dldt,0,qmvel112.peri,0,0,0,0,new.date)
if ret = 2 then
|could not find new.date!!
endif

k chandra reddy
30th September 2013, 13:20
Thanks you very much...

sasank
30th September 2013, 14:39
Hi,
Can you please suggest me the logic for the condition given?

Q)If shipment date of concerned Sale order & Item + warranty Months is greater than the cut. Off date(As given in the input selection) given in the report session then Qty to be added in this colomn

Rep:
if (tdsls401.dldt+(qmvel112.peri*30*24*3600)) > date then
qty = tdsls401.qidl
value = tdsls401.damt
else
qty = 0
value = 0
endif

if (tdsls401.dldt+(qmvel112.peri*30*24*3600)) < date then
qty1 = tdsls401.qidl
value1 = tdsls401.damt
else
qty1 = 0
value1 = 0
endif

As per this,condition is not satisfying and giving wrong values.