ISO Date Format Samples

SSIS Expression

(DT_WSTR, 4)YEAR(GETDATE())
+
RIGHT(“0″ + (DT_WSTR, 2)MONTH(GETDATE()), 2)
+
RIGHT(“0″ + (DT_WSTR, 2)DAY(GETDATE()), 2)

SSRS Expression

=CSTR(YEAR(Now)) + RIGHT(“0″ + CSTR(MONTH(NOW)), 2) + RIGHT(“0″ + CSTR(DAY(NOW)), 2)

DB2

SELECT REPLACE(CHAR(CURDATE(),ISO), ''-'', '''') 
FROM SYSIBM.SYSDUMMY1

SELECT CURDATE() - 3 DAYS
FROM SYSIBM.SYSDUMMY1

SELECT RTRIM(CHAR(YEAR(CURRENT DATE))) 
    || RIGHT('0' || RTRIM(CHAR(MONTH(CURRENT DATE))), 2) 
    || RIGHT('0' || RTRIM(CHAR(DAY(CURRENT DATE))), 2)
FROM SYSIBM.SYSDUMMY1

SELECT VARCHAR_FORMAT(CURRENT TIMESTAMP, 'YYYYMMDD') 
FROM SYSIBM.SYSDUMMY1

References:
http://en.wikipedia.org/wiki/ISO_8601

Advertisements

extract RDL from server

select Path
     , convert(varchar(max), convert(varbinary(max), content))
from reportserver.dbo.catalog
where content is not null

SSRS Filters

SSRS 2005 support filters at the dataset level, the table level, and group level.  For the aggregate functions, the scope must be specified correctly.

=FUNC(fields, scope)

The scope is a string for dataset name, table name, or group name.