Skip to Content
author's profile photo Former Member
Former Member

multiple parameter in crystal reports(CAse in SQL)

Hi All,

I am using add command in crystal report

and

Query is

select a.text_value, s.user_sampleid,ns.study from naiv_sample_attributes a inner join nai_samples s

on s.sample_id=a.sample_id

inner join nai_results r on s.sample_id=r.sample_id

inner join nai_submissions ns on

ns.submission_id=s.submission_id

where a.name='Date Received'

and

to_date(a.text_value,'DD-MON-yyyy HH24:mi:ss') between

to_date('01-APR-2013 08:53:22','DD-MON-yyyy HH24:mi:ss')

and to_date('30-APR-2013 08:53:25','DD-MON-yyyy HH24:mi:ss')

and r.Status in {&Status}

now Status parameter contains 3 values 'COMPLETE' , 'SUSPECT' and COMPLETE/ SUSPECT so if i select COMPLETE/ SUSPECT it should use COMPLETE and if I select SUSPECT it should take SUSPECT ,i need it to write in SQL only (i know we can do this through formula).How to write this by using case? if so please explain me

thanks

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Jan 07, 2014 at 10:22 PM

    hi Venkatesh,

    you shouldn't require a case statement for this as you're using a prompt / parameter to define the status in the where clause.

    you should have created a parameter inside the command as opposed to using an on-report parameter. once you have that command parameter you change the where clause last line to

    and r.Status = '{?Status}' or '{?Status}' = 'COMPLETE/SUSPECT'

    i'm assuming that if the end user selects complete/suspect that you want to show both complete & suspect...if that's not correct, please let me know what should be returned.

    cheers,

    jamie

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.