Crystal Reports equivalent of 'WHERE'

14,442

Add this to the record selection formula...

{datasetname.Dead} = true 
//note: I'm not sure what data type that is but CR uses bool for bit and XSD bool 

Then add a summary field to the report footer which does the count(id).

Or, if you need to display the dataset and only need a subquery you can use something called a "Running Total" field. In here you can do the count(id) and add the where clause to the necessary formula.

Share:
14,442
screechOwl
Author by

screechOwl

https://financenerd.blog/blog/

Updated on July 29, 2022

Comments

  • screechOwl
    screechOwl almost 2 years

    I'm familiar with SQL but not Crystal Reports. I'm trying to deal with an imported data set with 5 columns:

    id           deathDate           giftDate        giftAmount       Dead
    123           2008-01-06          2011-09-08       25.00          TRUE
    456           2009-06-08          2011-10-13       10.00          TRUE
    789              0                2011-12-04       50.00          FALSE
    ...
    

    I'm trying to do a subquery but can't figure out what the CR equivalent of WHERE in SQL would be. I'd like to do something along the line of:

    SELECT count(id) from tab1 where dead=TRUE
    

    Any suggestions?