Crystal Report Date formula to make it the end of the month

亡梦爱人 提交于 2019-12-02 01:22:38

Create a formula field to calculate the end of the month:

//{@EndOfMonth}
// find the first day of the month, add a month to it, then subtract a day
DateAdd("m", 1, DateTime( Year({table.dateField}), Month({table.dateField}), 1, 0,0,0 )) - 1

Create a second formula that will generate a textual representation:

//{@TextRepresentation}
If Isnull({table.end_date}) Then
  Space(8)
Else
  ToText({@EndOfMonth}, "YYYYMMDD")
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!