I'm trying to write a formula to show the number of days either between a start date and an end date or where the end date is blank, to use today's date. It will only show where there is an end date and shows blank where there is no end date. Can anyone tell me what I'm doing wrong? See below.
Local DateTimeVar d1 := {VIEW_EXCL_SCHEDULE.START_DATE};
Local DateTimeVar d2 := {VIEW_EXCL_SCHEDULE.END_DATE};
Local DateTimeVar d3 := currentdate;
If (isnull({VIEW_EXCL_SCHEDULE.END_DATE}))
then
(DateDiff ("d", d1, d3) - DateDiff ("ww", d1, d3, crSaturday) -DateDiff("ww", d1, d3, crSunday))
else
(DateDiff ("d", d1, d2) - DateDiff ("ww", d1, d2, crSaturday) -DateDiff("ww", d1, d2, crSunday))
Learn something new every day *:->*
AyJayEl
Local DateTimeVar d1 := {VIEW_EXCL_SCHEDULE.START_DATE};
Local DateTimeVar d2 := {VIEW_EXCL_SCHEDULE.END_DATE};
Local DateTimeVar d3 := currentdate;
If (isnull({VIEW_EXCL_SCHEDULE.END_DATE}))
then
(DateDiff ("d", d1, d3) - DateDiff ("ww", d1, d3, crSaturday) -DateDiff("ww", d1, d3, crSunday))
else
(DateDiff ("d", d1, d2) - DateDiff ("ww", d1, d2, crSaturday) -DateDiff("ww", d1, d2, crSunday))
Learn something new every day *:->*
AyJayEl