【问题标题】:Getting the Week Number for the Month Crystal Reports Formula获取当月 Crystal Reports 公式的周数
【发布时间】:2019-07-23 20:49:23
【问题描述】:

我有一个水晶报表Grouped by (Day,Week,Month)。 我希望能够显示该月的“周数”。例如:7 月的第 1 周、7 月的第 2 周、7 月的第 3 周等在“周”组标题中。

我尝试过使用公式

Totext(DatePart("ww", {Command.TransactionDate}),0)

但结果是 EX 的“周数”:33、34、35。任何帮助将不胜感激

【问题讨论】:

  • 我会尝试在 SQL 而不是 CR 中执行此操作。

标签: mysql vb.net crystal-reports


【解决方案1】:

使用这样的表达式:

datevar yourDate := currentdate;
Datepart("ww",yourDate)+1
- Datepart("ww",yourDate - Day(yourDate)+1)

当然,用你的日期替换变量赋值。

逻辑是获取日期的周数(加1)减去当月1号的周数。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多