RDLC中的FormatDateTime导致WEEK#返回 [英] FormatDateTime in RDLC resulting in a WEEK # return

查看:145
本文介绍了RDLC中的FormatDateTime导致WEEK#返回的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Visual Studio 2008创建RDLC:

Using Visual Studio 2008 to create the RDLC:

是否存在与 FormatDateTime(Today(),DateFormat.ShortDate)
[将于2012年5月29日返回今天]而是返回年份的周数[使用今天的日期这将返回22?

理论上可能是
FormatDateTime(Today(),DateFormat.Week)?

In theory perhaps FormatDateTime(Today(), DateFormat.Week)?

推荐答案

在RDLC中,我将表达式设置为...

In RDLC i set the expression to...

= int(DateDiff(DateInterval.Day,  DateAdd(DateInterval.Day, ( - Weekday(DateValue(" January 4,"& Format(Fields!Date.Value," yyyy)" )),0)+1),  DateValue(" 1月4日,  &安培;格式(Fields!Date.Value," yyyy"))),  Fields!Date.Value)/ 7)+1

=int(DateDiff(DateInterval.Day, DateAdd(DateInterval.Day, (-Weekday(DateValue("January 4, " & Format(Fields!Date.Value,"yyyy")),0)+1), DateValue("January 4, " & Format(Fields!Date.Value,"yyyy"))), Fields!Date.Value)/7)+1

这给了我所选日期的周数(字段!在这种情况下为Date.Value)。

That gives me the week number of a chosen date (Fields!Date.Value in this case).


这篇关于RDLC中的FormatDateTime导致WEEK#返回的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆