This is where I'm piling up my notes on MS Reporting Services, SQL Server, Analysis Services and such. It's mostly for me, but use it if it helps.

Tuesday, July 22, 2008

Dates in RS

To change July 2008 into 200807 use the following SQL
select datepart(year,mydate) * 100 + datepart(mm,mydate)


To change July 17, 2008 into 20080717

select datepart(year,mydate) * 10000 + datepart(m,mydate) *100 + datepart(d,mydate)


The DateDiff, DateAdd and DatePart VBScript Functions
(from codefixer.com)

MSDN: Custom Date String syntax
Use these in the Format field on the Properties for the textbox you want to clean up.

No comments: