Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Parameter not working Post Reply Post New Topic
Author Message
esther31
Groupie
Groupie


Joined: 19 Dec 2011
Online Status: Offline
Posts: 50
Quote esther31 Replybullet Topic: Parameter not working
     Posted: 03 Jan 2012 at 11:17pm
Hello
 
I'm struggling with a parameter, can aybody offer any advice please?
 
I have two parameters on a report but i want to be have the option to leave one blank, after looking at a report i've inherited i've got to here:
 
{SRS_URA.URA_APID} = {SRS_IOI.IOI_APID} and
if not (hasvalue({?Student ID:})) then true
else {SRS_URA.URA_APID} = {?Student ID:} and
{SRS_CAP.CAP_APID} = {SRS_IOI.IOI_APID} and
{SRS_CAP.CAP_AYRC} = {SRS_IOI.IOI_AYRC} and
{SRS_USA.USA_APID} = {SRS_IOI.IOI_APID} and
{SRS_CAP.CAP_MCRC} = {SRS_IOI.IOI_MCRC} and
{SRS_IOI.IOI_IODD} = {?Applicant Day:}
 
basically I want to be able to leave Student ID blank and run it just based on Applicant Day.
 
any help would be appreciated.
 
Thanks
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 04 Jan 2012 at 3:33am
i think that this is what you're after, though I don't have a clue what the fields are:
 
({SRS_URA.URA_APID} = {SRS_IOI.IOI_APID} and
hasvalue({?StudentID}) = false)
OR
(
{SRS_URA.URA_APID} = {?Student ID:} and
{SRS_CAP.CAP_APID} = {SRS_IOI.IOI_APID} and
{SRS_CAP.CAP_AYRC} = {SRS_IOI.IOI_AYRC} and
{SRS_USA.USA_APID} = {SRS_IOI.IOI_APID} and
{SRS_CAP.CAP_MCRC} = {SRS_IOI.IOI_MCRC} and
{SRS_IOI.IOI_IODD} = {?Applicant Day:}
)
or would it be:
({SRS_URA.URA_APID} = {SRS_IOI.IOI_APID} and
hasvalue({?StudentID}) = false and
{SRS_IOI.IOI_IODD} = {?Applicant Day:}
)
OR
(
{SRS_URA.URA_APID} = {?Student ID:} and
{SRS_CAP.CAP_APID} = {SRS_IOI.IOI_APID} and
{SRS_CAP.CAP_AYRC} = {SRS_IOI.IOI_AYRC} and
{SRS_USA.USA_APID} = {SRS_IOI.IOI_APID} and
{SRS_CAP.CAP_MCRC} = {SRS_IOI.IOI_MCRC} and
{SRS_IOI.IOI_IODD} = {?Applicant Day:}
)


Edited by lockwelle - 04 Jan 2012 at 3:34am
IP IP Logged
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 04 Jan 2012 at 5:06am
i think you need something like
if {parameter}= 1 then isnull({SRS_URA.URA_APID}) and
{SRS_IOI.IOI_IODD} = {?Applicant Day:} else
{parameter}= 2 then {SRS_URA.URA_APID} = {?Student ID:} and
{SRS_IOI.IOI_IODD} = {?Applicant Day:}

IP IP Logged
esther31
Groupie
Groupie


Joined: 19 Dec 2011
Online Status: Offline
Posts: 50
Quote esther31 Replybullet Posted: 05 Jan 2012 at 3:25am
Neither of these seem to be doing the trick, when I try and run it just with the {?Student ID:} parameter completed it doesn't return any records
 
Thanks
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 05 Jan 2012 at 4:24am
I dnot understand why youa re putting all of the table.field=table.field conditions in here as that should already have been addressedin your joins.
Therefore I think you only need something like this:
 
(not (hasvalue({?Student ID:}))
or
{SRS_URA.URA_APID} = {?Student ID:})
and
{SRS_IOI.IOI_IODD} = {?Applicant Day:}
 
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