[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 685
  • Last Modified:

SQL Expressions and Parameters

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
1 Solution
You could use a subreport to get the value and display it or pass it back in a shared variable.

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now