Results 1 to 2 of 2

Thread: Start And End Dates

  1. #1
    Join Date
    Oct 2004
    Posts
    4

    Start And End Dates

    hi may i know how do i load a report based on the entered value for start and end date?

    I understand that i have to create parameters and dataset but how to make use of them?

  2. #2
    Join Date
    Dec 2004
    Posts
    502
    How do you want to "load" the report? Do you mean you want to select records from a table or multiple tables and display them, or export them to another table or file? Just as a very simplistic example, you can have the following basic structure for a stored procedure:

    CREATE PROCEDURE test_sp
    @start_date char(10),
    @end_date char(10)
    AS

    INSERT INTO report_table
    SELECT * FROM data_table
    WHERE some_date >= @start_date
    AND some_date <= @end_date


    This will insert into a table based on the @start_date and @end_date you pass into the stored procedure. You call the stored procedure like this:

    EXECUTE test_sp '11/01/2004', '11/30/2004'

    Of course, you can pass in the dates in whatever datatype you want, based on what you define in the stored procedure.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •