I am trying to calculate the number of days between the scheduled day of a service order and the end of the month.
The formula I am using is:
Local DateVar tmpDate := {wkaw.sched_date};
(Dateadd("m",1,tmpDate)-Day(tmpDate))-tmpDate
With wkaw.sched_date being the scheduled date of the service call. The formula is in the GF.
This formulas works good for all months except if the scheduled date is Jan 31. I think the fact that Feb has 28 days is messing it up because it returns a value of a minus 3. It works fine for the last day of other months.
Can you tell me where I'm going wrong and/or is there an easier way of returning the last day of a current month?
Thanks
keo
kowen@rrwa.net
The formula I am using is:
Local DateVar tmpDate := {wkaw.sched_date};
(Dateadd("m",1,tmpDate)-Day(tmpDate))-tmpDate
With wkaw.sched_date being the scheduled date of the service call. The formula is in the GF.
This formulas works good for all months except if the scheduled date is Jan 31. I think the fact that Feb has 28 days is messing it up because it returns a value of a minus 3. It works fine for the last day of other months.
Can you tell me where I'm going wrong and/or is there an easier way of returning the last day of a current month?
Thanks
keo
kowen@rrwa.net