Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

select count statement with selection parameters

Status
Not open for further replies.

stewarttn

Programmer
May 20, 2004
6
US
Could someone please look at this statement and see why my count is 0 when I know it actually is 1 ?

SELECT
COUNT(PRECEPTOR_SITE_EVAL."ENTHUSIASTIC")
FROM
"PRECEPTOR_SITE_EVAL" PRECEPTOR_SITE_EVAL
WHERE
PRECEPTOR_SITE_EVAL."ENTHUSIASTIC" = '3'
AND
PRECEPTOR_SITE_EVAL."ACADEMIC_YEAR" = '{?ACADEMIC_YR)'
AND
PRECEPTOR_SITE_EVAL."BLOCK_NUMBER" = '{?BLOCK_NO}'

If I take the enclosing quotes off the selection parameters I get an error.
 
Which Crystal? I'd advise using some other method, summary totals or running totals.

I'd also write a test report to show the values, including a check for null values.
Code:
If isnull({value}) then "null" else totext({value})

Note that Crystal commands stop without warning on finding a null.

In my own work, I've been surprised how often data turns out to have values that I didn't think possible.

Madawc Williams (East Anglia)
 
Thanks for your help. I am using Crystal Reports 9.
I think I will work with you running totals suggestion.
 
Thanks, Madawc. I changed the program to use running totals and it is working beautifully. Thanks again for
your suggestion.

T.N. Stewart
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top