2015-09-06 29 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

感谢您的留言。 –