Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Record selection based on value in same row ms sql Post Reply Post New Topic
Author Message
Pyrotecnix
Newbie
Newbie
Avatar

Joined: 24 Jun 2010
Online Status: Offline
Posts: 16
Quote Pyrotecnix Replybullet Topic: Record selection based on value in same row ms sql
     Posted: 28 Jun 2010 at 11:10am
OK, here is the problem I'm trying to get this formula to work, maybe someone can help here is the current formula I have:

if {Call_Times.Time_Master_PKey} = 130000140
then {Call_Times.DateTime);

Here is my problem..
This is what the table I'm looking at looks like its called Call_Times:

Pkey          |Time_Master_Pkey| DateTime
---------------------------------------------------------------
130100091 | 130000139           | 2/3/1997 3:25:00 PM
130100091 | 130000140           | 2/3/1997 3:25:00 PM

Right now I have another table that supplies the Pkey and the above formula should be looking for the Time_Master_Pkey then when it finds it then returns the DateTime Column to be displayed but it doesn't matter what I put in for Time_Master_Pkey if it equals true it just prints the first row of the return. Can someone tell me how to make it so that when Time_Master_Pkey = value x return DateTime for that row or do I have to do it another way.

Edited by Pyrotecnix - 28 Jun 2010 at 11:14am
IP IP Logged
Emir_W
Senior Member
Senior Member
Avatar

Joined: 25 Apr 2010
Online Status: Offline
Posts: 228
Quote Emir_W Replybullet Posted: 28 Jun 2010 at 8:53pm
you can use 'JOIN' for the link between tables based on Pkey.
and from 'Report - Selection Formulas - Record' you can put your formula.
OR you can create a formula and put your formula there.
 
 
hope it help.
 
Emir W
IP IP Logged
Pyrotecnix
Newbie
Newbie
Avatar

Joined: 24 Jun 2010
Online Status: Offline
Posts: 16
Quote Pyrotecnix Replybullet Posted: 29 Jun 2010 at 1:55am
I'm well aware of the join for a link between the two tables. I have linked the pkey from the other table to the call_pkey in this table you are seeing it will list all the separate records based on that if I drop it in detail but I need them all in one area which is why I was trying to create a formula that will say if time_master_pkey is equaled to this then display this record from the row it matches, the record being the calldate. I have been researching it and people are saying that I would need to do a sub report possibly, but not sure at this time.
IP IP Logged
Emir_W
Senior Member
Senior Member
Avatar

Joined: 25 Apr 2010
Online Status: Offline
Posts: 228
Quote Emir_W Replybullet Posted: 29 Jun 2010 at 2:10am

mmm..

Change your formula (checkdate) as:
if {Call_Times.Time_Master_PKey} = '130000140' then
   {Call_Times.DateTime)
else
   "-"   ----> this is to identify if the record is not match
In Detail section put:
- {Call_Times.Pkey}, {Call_Times.TimeMasterKey} and {checkdate}
 
so, it will print all data including the record that match with the condition.
 
 
hope it help.
 
Emir W
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