all groups > sql server reporting services > august 2006 >
You're in the

sql server reporting services

group:

Convert DateTime Parameter to String


Convert DateTime Parameter to String RAGHAVAN JAYARAMAN
8/3/2006 11:16:11 AM
sql server reporting services: I have 2 reports and i have enabled Drilldown(Navigation) for the 1st Report.
One of the Parameter is DateTime which is passed to the 2 reports which should
treat this parameter as string since it's defined as string. How will i
convert the
DateTime to string Parameter for the Drilldown report. I tried all these
scenarios
for Parameter expressions and it doesn't work.

Convert.ToString(Parameters!Parameter2.value)
Convert.ToDateTime(Parameters!Parameter2.value).ToShortDateString()
FormatDateTime(Parameters!Parameter2.value,"mm/dd/yyyy")

Any help in this regard is appreciated? . I don't change the parameter for
second report to DateTime. Since it calls a WebService with parameters which
expects a string and not a System.DateTime.
RE: Convert DateTime Parameter to String magendo_man
8/4/2006 4:34:02 AM
Try:
=Format(Parameters!Parameter2.value,"MM/dd/yyyy")

Note month is MM=month not mm=minutes.

HTH,
Magendo_man


[quoted text, click to view]
RE: Convert DateTime Parameter to String RAGHAVAN JAYARAMAN
8/4/2006 1:54:01 PM
Thanks for the reply. I tried it,it didn't work but somehow i got it working
with Cdate syntax

= CDate(Parameters!Parameter2.value).ToShortDateString();

[quoted text, click to view]
AddThis Social Bookmark Button