Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: sub report with sql command Post Reply Post New Topic
Author Message
cajsoft
Newbie
Newbie


Joined: 23 Feb 2009
Location: United Kingdom
Online Status: Offline
Posts: 23
Quote cajsoft Replybullet Topic: sub report with sql command
     Posted: 14 Jan 2010 at 7:44am
Hi,
I am passing a date value parameter (?pm-@date1) to my subreport.

the subreport uses a command to return the data.. I need to create a select statement in the sql command with the value from the date parameter.
eg.


select * from customers where date1 > ?pm-@date1


is this possible?

thanks
Craig.
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 14 Jan 2010 at 1:14pm

This can be an issue because Crystal sees parameters for commands slightly differently that regular parameters.  Here's what I've done successfullly in the past:

1.  BEFORE setting up the link to the main report, create your command.  Set up the parameter in the command using the EXACT same parameter name that Crystal will use for the link.  This will initialize the parameter for the subreport.
 
2.  Now set up the link.
 
This makes sure that the parameter is connected to everything it needs to be in order to work correctly.  Note:  If you already have your subreport set up, remove the existing parameter from everywhere in the subreport, including the command and the link.  Save.  Then reconfigure the parameter back into the command and reset the link.
 
-Dell
IP IP Logged
cajsoft
Newbie
Newbie


Joined: 23 Feb 2009
Location: United Kingdom
Online Status: Offline
Posts: 23
Quote cajsoft Replybullet Posted: 15 Jan 2010 at 12:36am
thanks, I'll give this a try.
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