下面,列出一些实用的表达式:
1,路径取文件名
RIGHT([FilePath],FINDSTRING(REVERSE([FilePath]),"\\",) - )
RIGHT(@[User::FilePath],FINDSTRING(REVERSE(@[User::FilePath]),"\\",) - )
2,空字符设置默认值
3,数字
例如:123 变 00123
RIGHT(("" + [STRING_COLUMN]), )
REPLICATE("", - LEN([STRING_COLUMN])) + [STRING_COLUMN]
4,日期
(DT_DATE)(DT_DBDATE)@[User::datetimeVariable]
(DT_DATE)(DT_DBDATE)[datetimeColumn]
(DT_DBTIMESTAMP)(DT_DBDATE)GETDATE()
日期转化成字符串
(DT_WSTR, )YEAR( GETDATE()] )+RIGHT(""+(DT_WSTR, )MONTH( GETDATE()) , )+ RIGHT(""+(DT_WSTR, )DAY( GETDATE() ) , )
5,时间
(DT_STR,,)(DT_DBTIME)@[User::datetimeVariable]
(DT_STR,,)(DT_DBTIME)[datetimeColumn]
(DT_STR,,)(DT_DBTIME)GETDATE()
6,当前月第一天
DATEADD("d", -DAY(GETDATE()) + , GETDATE())
(DT_DBTIMESTAMP)(DT_DBDATE)DATEADD("d", -DAY(GETDATE()) + , GETDATE())
7,当前月最后一天
DATEADD("d", -DAY(GETDATE()), DATEADD("m", , GETDATE()))
DT_DBTIMESTAMP)(DT_DBDATE)DATEADD("d", -DAY(GETDATE()), DATEADD("m", , GETDATE()))
8,最后一秒
DATEADD("s", -,DATEADD("d", -DAY(GETDATE()) + , DATEADD("m", , (DT_DBTIMESTAMP)(DT_DBDATE)GETDATE())))