SQL Expressions and Parameters

Posted on 2009-02-10
Last Modified: 2012-06-27
I am using Crystal 2008

I want to be able to use a parameter from the report for my dates in the SQL Expression. I've looked around and I understand this is not possible still? Do I need to create a Stored Procedure on the database first? Can I then send the parameters over to the Stored Procedure?

Here is my SQL Expression and I would like to use the parameters {?StartDate} and {?EndDate}.  Any help would be appreciated!

SELECT count (Record_Number)
  FROM [MyFocusPOS].[dbo].[CHECK]
  where storeid = '4'
  and check_file_date > '2/5/2009' and
  check_file_date < '2/9/2009'
  and flag_used is null
  and all_seats_voided is null
Question by:mattkovo
    LVL 100

    Expert Comment

    You could use a subreport to get the value and display it or pass it back in a shared variable.

    LVL 4

    Accepted Solution

    1.  add check_file_date as a field in your SELECT Statement.
    2.  in Report/Selection Formulas/Record.... say
         check_file_date >= {?StartDate}  and
         check_file_date <= {?EndDate}


    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
    Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    26 Experts available now in Live!

    Get 1:1 Help Now