Can someone please point me how I can issue a MDX query to get today's
date. I know I can use something like VBA!Now()
But I want to get this from a MDX query so I can use in Reporting
Services to populate the
default value for my report parameter called FromParam in the following
format
2006009 which is month 9 for year 2006.
Kindly help me with this MDX query that enables me to get the period in
the above format,
Thanks
KarenTHis is what I do when I need to get "Today" to use as a default:
Connect to a SQL database
Create a query like this:
select cast(DATEPART(year, getDate()) as varchar(20)) +
case len(Datepart(month, getDate()))
when 1
then '0' + cast(DatePart(month, Getdate()) as varchar(2))
else cast(DatePart(month, Getdate()) as varchar(2))
end
as ShowToday, GetDate() as Today,
'[Date].[Year].&[' + cast(DATEPART(year, getDate()) as varchar(4)) + '].&['
+
cast(DatePart(month, Getdate()) as varchar(2))
+']'
as OlapToday
Use either the value returned for ShowToday or OlapToday as my default
value.
OK, it's not MDX, but it does the trick. ;)
Kaisa M. Lindahl Lervik
"KarenM" <karenmiddleol@.yahoo.com> wrote in message
news:1158928968.212395.86710@.i3g2000cwc.googlegroups.com...
> Can someone please point me how I can issue a MDX query to get today's
> date. I know I can use something like VBA!Now()
> But I want to get this from a MDX query so I can use in Reporting
> Services to populate the
> default value for my report parameter called FromParam in the following
> format
> 2006009 which is month 9 for year 2006.
> Kindly help me with this MDX query that enables me to get the period in
> the above format,
> Thanks
> Karen
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment