Results 1 to 5 of 5

Thread: Crystal Reports 10 Formula Issue?

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jan 2004
    Location
    Southern California
    Posts
    5,034

    Crystal Reports 10 Formula Issue?

    I have a CR 10 report in which it takes a Date Parameter. This parameter is defined Where "Allow multiple values" is checked and "Discrete and Range Values" is selected.

    I'm not sure if my Record Selection criteria is correct for this Parameter. Here is what the Record Selection looks like.

    Code:
    {AR_OpenInvoice.InvoiceType} = "FC" and
    {AR_OpenInvoice.CustomerNo} = {?CustNo} and
    {AR_OpenInvoice.InvoiceDate} = {?InvoiceDate}
    The highlighted line doesn't seem to be working. Basically, the query is not returning a range of records between the 2 date parameters and I don't think I have that highlighted line set up right but not sure how to construct it. The image below is how I have setup my Parameter. Any ideas?

    Thanks,
    Last edited by blakemckenna; May 27th, 2009 at 11:47 AM. Reason: Adding screenshot
    Blake

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: Crystal Reports 10 Formula Issue?

    All you need to do is use In instead of =

    {AR_OpenInvoice.InvoiceDate} In {?InvoiceDate}

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Jan 2004
    Location
    Southern California
    Posts
    5,034

    Re: Crystal Reports 10 Formula Issue?

    even though there are 2 dates?
    Blake

  4. #4
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: Crystal Reports 10 Formula Issue?

    1, 2 or 1000 dates it doesn't matter. The SQL Statement generated by Crystal ensures the Date field is checked against each Range or Discrete value in the Parameter.

    Because the parameter allows multiple Ranges and/or Discrete values a user could enter all of the following

    01-Mar-1998 31-Mar-1998 'Range value
    24-Jul-1997 'Discrete value.
    17-Jul-1997 'Discrete value.
    01-Jan-1998 31-Jan-1998 'Range valuie

    The SQL statement generated by Crystal would be (depending on database and connection type)

    InvoiceDate >= {d '1998-03-01'} AND InvoiceDate <= {ts '1998-03-31 23:59:59.000'} OR
    InvoiceDate>= {d '1997-07-24'} AND InvoiceDate <= {ts '1997-07-24 23:59:59.000'} OR
    InvoiceDate >= {d '1997-07-17'} AND InvoiceDate <= {ts '1997-07-17 23:59:59.000'} OR
    InvoiceDate >= {d '1998-01-01'} AND InvoiceDate <= {ts '1998-01-31 23:59:59.000'}

  5. #5

    Thread Starter
    PowerPoster
    Join Date
    Jan 2004
    Location
    Southern California
    Posts
    5,034

    Re: Crystal Reports 10 Formula Issue?

    Thanks Bruce....I tried doing that and it didn't work, however, I think we may some database issues. But what you are saying makes sense and I will stick with that.

    Thanks again for your help!
    Blake

Posting Permissions

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



Click Here to Expand Forum to Full Width