blog.Toby

  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  130 随笔 :: 2 文章 :: 150 评论 :: 0 Trackbacks
應用案例:Reporting Service 報表參數預設值技巧

例一:預設值為昨日

1 dateadd("d",-1,today) 
view plain | print | copy to clipboard | ?

 

說明:將今天日期加上【-1】。

函數:dateadd , today

例二:預設值為上月最後一天

1 dateadd("d",-1, cdate("#" & year(today).ToString   
2 "/" &   month(today).ToString  & "/1#"))  
view plain | print | copy to clipboard | ?

 

說明:先取得【本月第一天】的日期,再加上【-1】,就可得到【上月最後一天】。

函數:dateadd , cdate , year , today , month

例三:預設值為上月第一天

1 cdate("#" & year(dateadd("m",-1,today)).ToString   
2 "/" &   month(dateadd("m",-1,today)).ToString  & "/1#")  
view plain | print | copy to clipboard | ?

 

說明:先取得上月份的年度,接著取得上月份,最後連同字串1一起串連。

函數:cdate , year , dateadd , today , month 

posted on 2008-03-11 12:16 渠上月 阅读(1114) 评论(0)  编辑  收藏 所属分类: VS 2005

只有注册用户登录后才能发表评论。


网站导航: