Using parameter in a Command

I have a report that is using an excel sheet as a data source.
I want to pass a parameter in the command.
Here’s an example:

SELECT 
          DI.`A`, 
          DI.`B`, 
          DI.`date` 
FROM   
          `Donnees_incidents$` DI
WHERE
          DI.`date` = {Pm-@F_date_execution}

I get a syntax error with this code…
I’m using CrystalReport XI by the way…


madbash :canada: (BOB member since 2008-08-01)

Parameters should have the format {?Parameter}. I have never used a command with an Excel data sheet, but I would suspect that your parameter should be {?Pm-@F_date_execution}. When using MS-SQl and Informix SQL you also have to put the parameter inside of single quotes and have the parameter defined in the Command dialog screen.

I hope this helps.


kevlray :us: (BOB member since 2010-06-23)

Half of my problem is now ok.

I have the main report which is passing a parameter into the sub-report.
It is this parameter that I want to use in the Commamd of the sub-report.


madbash :canada: (BOB member since 2008-08-01)

As long as the name is defined in the command of the sub-report, I believe you should be able to link from the main report. I am not passing a parameter to a sub-report, but I passing a field value to a sub-report that has a parameter in the command (Informix ODBC).

I hope this helps.


kevlray :us: (BOB member since 2010-06-23)

Thank you!

You’ve been a great help.
As long as the name is the same and it is define in the command, the connexion is made…

Thank you again…


madbash :canada: (BOB member since 2008-08-01)