Skip to Content
avatar image
Former Member

How to Pass Current Date As End Date In SQL Pramaeters

Hi All

I am using stored procedure in Crystal reports it has start date and end date

with out  using sub report how can i pass end date as current date  in SQL Command line

in Crystal reports

Please Advise

Thanks

Krishna M

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Oct 26, 2015 at 03:47 PM

    Hi Krishna,

    You could try calling the SP using a Command Object:

    E.g command for Oracle:

    Exec Procedure_Name to_date({?Start_Date}), sysdate


    {?Start_Date} is a prompt that is created in the Command window.


    -Abhilash

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hey Thanks abhilash with you support only it is possible  did some small modifications to the stored procedure

      found the solution

      DECLARE @GetDateValue datetime;

      SET @GetDateValue = GetDate();

      Exec [dbo].[cr_projects] 'IND','01/01/2015', @WeekEndDate = @GetDateValue;

  • Oct 26, 2015 at 03:45 PM

    Instead of calling the stored proc as a data source, create a command that will call the stored proc.  You can then use the database syntax to pass the current date as the end date parameter.

    For more information about using commands, see my blog post here:  Best Practices When Using Commands with Crystal Reports.

    -Dell

    Add comment
    10|10000 characters needed characters exceeded