2015-09-06 30 views
0

我是水晶報表新手。我在報告中有兩個日期字段:Benefit Start&Benefit End Dates如何在水晶報表中硬編碼日期部分日期

我必須比較僱員的年齡。

1) If age>65 years, Benefit Start date should be '20160101'. 
2) If age<65 years, Benefit Start date should be first day of the month effective. 
eg: if the date is '09/21/2015', the output should be'09/01/2015'. 

同樣的好處結束日期,

If age<65 years, Benefit End date should be last day of the month effective. 
eg: if the date is '09/02/2015', the output should be'09/30/2015'. 

如何硬編碼在日期的日子裏,讓我得到了第一天的月份&最後一天兩個領域?

請幫我

在此先感謝。

回答

0

拿到一個月使用

DateSerial ((Year (CurrentDate)),(Month (CurrentDate)) ,Day (Minimum (LastFullMonth))) 

的第一天拿到最後一天使用

Dateserial(year(currentdate),month(currentdate)+1,1-1) 

請與您的日期公式替代的currentdate。

+0

感謝您的留言。 –