reporting services中关于数字转化为时间时空值的处理

经常遇到将类似201103这样的数字转换为Mar-11类型的需求。当其中有空值时则报表中会显示#error。如下代码可修正:

=iif( 

cdate(iif(isnothing(Fields!EndExtension.Value),"01/01/1900","01/" &
 right(Fields!EndExtension.Value,2) &"/" & left(Fields!EndExtension.Value,4)))="01/01/1900","", 
 cdate(iif(isnothing(Fields!EndExtension.Value),"01/01/1900","01/"&right(Fields!EndExtension.Value,2) &
  "/" & left(Fields!EndExtension.Value,4))).ToString("MMM-yy")
  )

你可能感兴趣的:(数字,职场,休闲,Services,时间时空值)