Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: SQL Expression use a parameter Post Reply Post New Topic
Author Message
Central
Groupie
Groupie


Joined: 16 Feb 2011
Online Status: Offline
Posts: 56
Quote Central Replybullet Topic: SQL Expression use a parameter
     Posted: 09 Apr 2013 at 11:47pm
Hi,
 
I have a report and I want to use the SQL Expression with a parameter 
 
An example is like as below
 
(
Select max("Employer"."SalesDate")
from Employer where "Employer"."CaseID" = {?EmpID}
)
 
 {?EmpID} is a parameter
 
I keep getting an error.
 
How can this be done or is there a different way?
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 10 Apr 2013 at 6:38am
If you are using MS-SQL I believe you need to put single quotes around the parameter (i.e., ' {?EmpID}').  Why, I do not know, but it works for me.
IP IP Logged
Central
Groupie
Groupie


Joined: 16 Feb 2011
Online Status: Offline
Posts: 56
Quote Central Replybullet Posted: 11 Apr 2013 at 2:45am
Thanks for getting back to me with a solution.
 
I will give it a try.
 
Thanks again
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum