Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: SQL Command Parameters Post Reply Post New Topic
Author Message
Lewe22
Newbie
Newbie


Joined: 04 Jan 2008
Online Status: Offline
Posts: 7
Quote Lewe22 Replybullet Topic: SQL Command Parameters
     Posted: 18 Feb 2008 at 5:55am
I'm using Crystal 10 within Visual Basic 6 and am having trouble with a command parameter.
 
I have a VB 6 database which i am trying to add a Crystal Report to but am encountering problems with my parameter.
 
I have created the report using a command which includes the paramater SESS. I have dropped SESS onto the detail of my report.
 
My problem is that i am not prompted for SESS when running the report from my database. The only way i receive the prompt for SESS is when i access the report in design mode, and edit, then close my command.
 
This is far from ideal, and negates the use of a parameter entirely.
 
I'm really stuck...can anyone help me??
 
 
SQL from my command is:
 
SELECT
    sub1.ESOLExamHistStudRef,
    ViewExamHistESOL.ESOLExamHistSess,
    ViewExamHistESOL.ModuleDescript,
    ViewExamHistESOL.SylOptDescript,
    ViewExamHistESOL.ResultDescript,
    ViewExamHistESOL.TutorDescript 
FROM
   (SELECT
        ESOLExamHistStudRef
    FROM
        ViewExamHistESOL
    WHERE
        ESOLExamHistSess = {?SESS}
    GROUP BY
        ESOLExamHistStudRef
    ) sub1
    LEFT OUTER JOIN ViewExamHistESOL
        ON sub1.ESOLExamHistStudRef = ViewExamHistESOL.ESOLExamHistStudRef
WHERE
    ViewExamHistESOL.ESOLExamHistSess <= {?SESS}
ORDER BY
    sub1.ESOLExamHistStudRef,
    ViewExamHistESOL.ESOLExamHistSess DESC
 
 
 
 


Edited by Lewe22 - 18 Feb 2008 at 5:58am
IP IP Logged
Lewe22
Newbie
Newbie


Joined: 04 Jan 2008
Online Status: Offline
Posts: 7
Quote Lewe22 Replybullet Posted: 19 Feb 2008 at 2:41am

Don't know what the problem was but I managed to fix it by moving the sub query out and creating it as it’s own command. I kept the SESS parameter in the original command and then just linked them via the ESOLExamHistSess field.

 

This seems to have done the trick along with assigning a field on the report to SESS using the select wizard.

 

Hope that made sense!



Edited by Lewe22 - 19 Feb 2008 at 2:42am
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