【问题标题】:How to hard code days part in dates in crystal reports如何在水晶报告中硬编码日期部分
【发布时间】:2015-09-23 00:06:11
【问题描述】:

我是水晶报表的新手。我的报告中有两个日期字段: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'.

如何对日期中的日期进行硬编码,以便我获得两个字段月份的第一天和最后一天?

请帮帮我

提前致谢。

【问题讨论】:

    标签: date crystal-reports


    【解决方案1】:

    获取当月的第一天使用

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

    最后一天使用

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

    请将 CurrentDate 替换为您的日期公式。

    【讨论】:

    • 感谢您的帖子。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-11-06
    • 1970-01-01
    • 2015-02-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多