All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
asp.net,2.0,客户端回调实现全国省市县3级联动下拉列表_[Asp.Net教程]
通过查询分析器对比SQL语句的执行效率_[SQL,Server教程]
visual c++中的函数模板
增加Apache最大连接数的方法详细介绍_php资料_编程技术
PHP技巧:PHP脚本中关于拼写检查函数库_[PHP教程]
Windows Vista下安装SQL Server 2005_[SQL Server教程]
关于.NET中MD5加密与ASP中MD5加密值不同的解决办法_[Asp.Net教程]
温故知新ASP.NET,2.0(C#)(6),-,Membership&RoleManager_[Asp.Net教程]
迁移你的Web页面到ASP.NET,AJAX,1.0_.net资料_编程技术
Visual C++ 6.0教程:c++数据类型之枚举
Reading number is top 10 pictures
这玉米,买还是不卖?
Take you to walk into the most true north Korea rural4
全球清廉国家排行
湖边的风景
YangYuYing and ZhengShaoQiu dance on the generous come interest dye-in-the-wood
Embarrassing things comic collection2
Small s breast enhancement demonstration
More attractive than sora aoi2
A beautiful girl to bud2
Ashlynn Brooke photograph of a group1
Download software ranking
Such love down(擒爱记)
I'm come from Beijing2
1400篇各类破解文章
金山office2007
Boxer's Top ten classic battle9
Tram sex maniac 2 (H) rar bag12
Wild things 2
The Bermuda triangle2
White deer villiage
matrix1
归海一刀 published in(发表于) 2014/2/3 6:34:53 Edit(编辑)
SQL Server 2005 Reporting Services 报表中随意格式化日期的方法_[SQL Server教程]

SQL Server 2005 Reporting Services 报表中随意格式化日期的方法_[SQL Server教程]

SQL Server 2005 Reporting Services 报表中随意格式化日期的方法_[SQL Server教程]

在SQL Server 2005 Reporting Services 报表中格式化日期的方法可以 FormatDateTime的函数,下面是它的定义:
Visual Basic (Declaration)
Public Shared Function FormatDateTime ( _
Expression As DateTime, _
Optional NamedFormat As DateFormat = DateFormat.GeneralDate _
) As String

Visual Basic (Usage)
Dim Expression As DateTime
Dim NamedFormat As DateFormat
Dim returnValue As String
returnValue = Strings.FormatDateTime(Expression, NamedFormat)

下面是NamedFormat 的定义:
Constant
Description

DateFormat.GeneralDate
Display a date and/or time. Display a date part as a short date. If there is a time part, display it as a long time. If present, both parts display.

DateFormat.LongDate
Display a date using the long date format specified in your computer's regional settings.

DateFormat.ShortDate
Display a date using the short date format specified in your computer's regional settings.

DateFormat.LongTime
Display a time using the time format specified in your computer's regional settings.

DateFormat.ShortTime
Display a time using the 24-hour format (hh:mm).


它的类型就这么几种,很有限的,远远不能满足我们的需要。那怎么办?


实际上在报表中可以使用 ToString 的方法,来定义任意格式的字符串格式。比如:
cdate(“2007-12-12 1:3:40”).ToString("yyyy-MM-dd") 可以格式化成 2007-12-12的格式,还可以格式化成12/12/2007这样的格式,甚至可以格式化成 2007+12+12这样的格式。这样只要你的format 格式化字符串正确,就可以实现你想要的日期格式。


来源:网络







添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.