Those are my beginning and end date formulas that are in my header.
BEGDATE =
dateVar EndMonth := Date(Year(DataDate),Month(DataDate),01)-1;
If {?BegDate} = Date(1800,01,01) Then
(Date(Year(EndMonth),Month(EndMonth),01))
else
if {?BegDate} = Date(1850,01,01) then
minimum(lastfullweek)
else
if {?BegDate} = Date(1900,01,01) then currentdate -1
else
If {?BegDate} = Date(1925,01,01) Then
dateadd('q',datediff('q',date(1900,1,1),today)-1,date(1900,1,1))
Else
{?BegDate}
ENDDATE =
If {?EndDate} = Date(1800,01,01) Then
Date(Year(DataDate),Month(DataDate),01)-1
else
if {?EndDate} = Date(1900,01,01) then currentdate - 1
else
if {?EndDate} = Date(1850,01,01) then
maximum(lastfullweek) else
If {?EndDate}= Date(1925,01,01) Then
Switch (Month(DataDate) in 1 to 3,Date(Year(DataDate),01,01),
Month(DataDate) in 4 to 6,Date(Year(DataDate),03,31),
Month(DataDate) in 7 to 9,Date(Year(DataDate),06,30),
Month(DataDate) in 10 to 12,Date(Year(DataDate),09,30))
Else
{?EndDate}
|