Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Can we create a view in Crystal Report? Post Reply Post New Topic
Author Message
sophieTaureau
Newbie
Newbie


Joined: 26 Jan 2012
Online Status: Offline
Posts: 17
Quote sophieTaureau Replybullet Topic: Can we create a view in Crystal Report?
     Posted: 26 Jan 2012 at 3:36am

Hi,

I need to create a view like in sql, the part in parenthesis like this:
 
select xxx
from xxx, ( select xxx
                  from xxx)
 
Would I? If not, what I can do to realise it?
 
Thanks so much...


Edited by sophieTaureau - 26 Jan 2012 at 3:36am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 26 Jan 2012 at 3:55am
this would be a command object
IP IP Logged
sophieTaureau
Newbie
Newbie


Joined: 26 Jan 2012
Online Status: Offline
Posts: 17
Quote sophieTaureau Replybullet Posted: 26 Jan 2012 at 4:22am
Thanks DBlank
But in this view I want the complicated request like:
minimum(@duration), so I think command objet can't do that...
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 26 Jan 2012 at 4:26am
if @duration is a parameter you can add params into command objects and it is possible.
if @duration is a formula field in your report it would have to be created in the command


Edited by DBlank - 26 Jan 2012 at 4:26am
IP IP Logged
sophieTaureau
Newbie
Newbie


Joined: 26 Jan 2012
Online Status: Offline
Posts: 17
Quote sophieTaureau Replybullet Posted: 26 Jan 2012 at 5:28am

Dear Mr DBlank

@duration is a formula field !!
 
Would you help me clarifing how to create a formula in the command like minimum(@duration),
effect I want is:
select CodeP, minimum(@duration)
from table1
group by CodeP;
 
PLEASE!!!
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 26 Jan 2012 at 5:53am

what is the formula for @ duration or what is it supposed to be calculating?

IP IP Logged
sophieTaureau
Newbie
Newbie


Joined: 26 Jan 2012
Online Status: Offline
Posts: 17
Quote sophieTaureau Replybullet Posted: 26 Jan 2012 at 7:11am
@ duration =start-finish, it's not important,
Mr DBlank , I want know How to apply the formula in command
in the field SQL when creating the command?
or the step(clik where)  please!Smile
 
Ps: because we can only create parameter when creating command, and parameter can't link with formule....
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 26 Jan 2012 at 7:33am
you cannot reference a crystal fomrula in the command but you can use SQL to replicate the formula result in the command
 
SELECT     codep, MAX(DATEDIFF(day, StartDate, EndDate)) AS duration
FROM         table1
GROUP BY codep
IP IP Logged
sophieTaureau
Newbie
Newbie


Joined: 26 Jan 2012
Online Status: Offline
Posts: 17
Quote sophieTaureau Replybullet Posted: 26 Jan 2012 at 11:36pm
Thanks so much, DBlank I will try that
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