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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal Reports XI - Parameter within Add Command

Status
Not open for further replies.

Ornelasi

Technical User
Oct 3, 2012
2
US
I am trying to add a parameter to an ADD COMMAND and keep getting "Failed to retrieve data from the database" Here is an example of my code:

SELECT * FROM Projects WHERE ProjectId = {?ProjID}

I have searched through the internet and what I have read; the above should have worked. The values for the parameter need to be dynamic. Any ideas.

Please help.
 
If is an MSSQL DB. I have found that it likes single quotes around the prompt.

SELECT * FROM Projects WHERE ProjectId = '{?ProjID}'
 
I tried that also. From what I read is you put single quotes if it is a string. Since this value is numeric, that doesn't work.

Thanks for the info though. I will keep researching.
 
You can not use normal report parameters. You must create and use Parameter from within the Command Editor.

In Crystal 10 if you amend command you have to delete paramter, recreate and add in again. Hopefully this bug was eliminated in later versions.

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top