Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro passing date prompt to Impromptu

Status
Not open for further replies.

Exie

Programmer
Sep 3, 2003
156
AU
Hi,

I have a macro and am trying to pass a string and a date into impromptu to fulfill 2 prompts the report has.

The macro writing doco mentions they need to be separated by a pipe (which I've done), and I read somewhere that they must be strings, which I've done, but I still get the error:
"Impromptu: Parameter 2 is invalid"

The string I'm passing looks like:
"Metro-North|2004-03-02 00:00:00.000"

The second prompt var is (obviously) a datetime stamp. This is used to control the period the report runs for.
 
Exie

Your correct in what you say that Prompts have to be passed through to impromptu as strings, so the prompt in the report has to be a string also and then handled to match the data type required i.e. change the record filter to something like

datetime-to-date(date-to-string(RecordDate))=?DatePrompt?

N.B. Date-to-string returns the date in the format yyyy-mm-dd so you will need to amend the prompt string in your macro to "Metro-North|02-03-2004"

HTH

Gary Parker
Systems Support Analyst
Manchester, England
 
Thanks folks,

I eventually realised I made a mistake in my script. I was passing the string into my macro as strPrompt1 and then trying to use:
objImpApp.OpenReport(strSourcePath & strSourceFile,strPrompt)

Such a stupid mistake! after this it all started working.

Thanks again for your posts!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top