locked
how to declare parameter sql command with parameter crystal report in sqlc command crystal report RRS feed

  • Question

  • User910710390 posted

    I try it but does not give me data

    declare @Status nchar(40) ,            
      @crd nchar(40) ,              
    @cust int ,             
     @fromdate datetime,          
        @todate   datetime ; 
    set @Status ={?@Status}; 
    set @crd={?@crcl}; set @cust={?@cust}; 
    set @fromdate={?@fromdate}; 
    set @todate ={?@todate}; 
    select Custom_Captions.Capt_Family,Media.medi_number,Custom_Captions_1.Capt_Family,Media.medi_scndno,Media.Medi_Name,Custom_Captions_3.Capt_Family,Media.medi_status,Custom_Captions_2.Capt_Family,Custom_Captions_2.Capt_US,Media.medi_crcltype,Media.medi_customer,Company.Comp_Name,Media.medi_daterec From  crm.dbo.Media Media inner join crm.dbo.custom_captions  Custom_Captions on Media.medi_crcltype=Custom_captions.Capt_Code inner join crm.dbo.custom_captions Custom_Captions_1 on Media.medi_advrcat=Custom_Captions_1.Capt_Code inner join crm.dbo.custom_captions  Custom_Captions_3 on Media.medi_status=Custom_captions_3.capt_code left outer join crm.dbo.custom_captions Custom_captions_2 on Media.medi_crcltype=Custom_Captions_2.Capt_Code  left outer join crm.dbo.Company Company on Media.medi_customer=Company.comp_CompanyID Where (Custom_Captions_1.Capt_Family is null or Custom_Captions_1.Capt_Family=N'medi_advrcat')  and (Custom_captions_3.Capt_family is null or custom_captions_3.Capt_Family=N'medi_status') and Custom_captions.Capt_family=N'crcl_type' and (custom_captions_2.capt_family is null or Custom_Captions_2.Capt_family=N'crcl_type') and Media.medi_status=@Status and Media.medi_crcltype=@crd and Media.medi_customer=@cust and Media.medi_daterec >=@fromdate  and Media.medi_daterec <=@todate
    
    how can I do it for add command in crystal report

    please help me

    Thank' for you guids

    Monday, February 24, 2014 8:15 AM

Answers

  • User910710390 posted

    it is correct code but i resolve prblem in my select expert  , I resloved it

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, February 25, 2014 10:24 AM