Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Joining tables Post Reply Post New Topic
<< Prev Page  of 2
Author Message
KevV
Senior Member
Senior Member


Joined: 19 May 2011
Online Status: Offline
Posts: 106
Quote KevV Replybullet Posted: 01 Dec 2011 at 3:53am

I think I got it. The only thing I am not sure is I have a formula that uses a field in one of the tables that uses a parameter for a date written as:

 
{?Date} ={pickdetail.date_picked}[1 to 8]
 
Is there a way to put this in the SQL or how would I make the date_picked a field in the command table.
 
Thanks
KevV
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 01 Dec 2011 at 4:25am
the command itself can have a parameter.
You create it on the right hand side of the command screen
name it date
set the prompt text
value type=string
leave default value as null
 
update or add in your where clause to the command and include the param.
make sure to put single quotes around it.
something like
 
where left({d.date_picked},8) = '{?date}'
 
does that help?
IP IP Logged
KevV
Senior Member
Senior Member


Joined: 19 May 2011
Online Status: Offline
Posts: 106
Quote KevV Replybullet Posted: 01 Dec 2011 at 4:54am
That was a huge help. I did have to make a change in the statement though. With the one above I got the rowset error so I changed it to :
 
where d.date_picked[1,8] = '{?date}'
 
and it worked perfectly. Thanks for all the help. One more thing I am hoping you can help me with is I am doing some counts and I have a fomula where if a number is between two numbers it is rounded like:
 
if {@Minutes} in "0" to "15" then "15" else
if {@Minutes} in "16" to "30" then "30"
 
I then need to count all of the 15's and 30"s and show the total of each in the header or footer. I can do a Running total and count for each and it counts in the detail section but if i put it in the footer or header it shows 0.
 
Thanks KevV 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 01 Dec 2011 at 5:01am
Running totals (or variable formual counts) only show the amount that it has processed up to the location that you place it in the report (like whileprintingrecords). Insert Sumaary function (or its equivalent in a formula) are created in an early enough pass to display the result in a header.
If you do not have duplicate data rows you can create 2 formulas to do your display.
//15min_count
if {@Minutes} in "0" to "15" then 1
//30min_count
if {@Minutes} in "16" to "30" then 1
 
now you can dop a SUM on each of these at any level of the report
 
IP IP Logged
KevV
Senior Member
Senior Member


Joined: 19 May 2011
Online Status: Offline
Posts: 106
Quote KevV Replybullet Posted: 01 Dec 2011 at 5:20am
Awesome Thanks again for the help
 
KevV
IP IP Logged
<< Prev Page  of 2
Post Reply Post New Topic
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



This page was generated in 0.000 seconds.