I have a stored proc which accepts a date parameter as an int (YYYYMMDD) and
which I do not want to change. I want to create a report which allows users
to enter the date as a date and then convert this to the int format before
passing it to the stored proc. I've already created the following custom code
to do the conversion:

Function ConvertDate(ByVal DateIn As Date) as String
Dim StringDate as String
Return DATEPART(DateInterval.Year,dateIn) &
DATEPART(DateInterval.Month,dateIn) & DATEPART(DateInterval.Day,dateIn)
End Function

How would I assigned the converted date to the parameter before it gets
passed to the stored proc.

RE: How to convert parameter before passing it to the stored procedure by jonhp

jonhp
Tue Sep 13 12:22:51 CDT 2005

You can set an expression in the query parameter value to make a call to
your custom code which is embedded as a code block into the report. Pass
the report parameter as a function parameter.

<Code>
Function MyCustomFunction(...) as String
...
End Function
</Code>