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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Basic Question on Using Count Function With Complex Conditions 1

Status
Not open for further replies.

drosenkranz

Programmer
Sep 13, 2000
360
US
I have to roll up totals for "case_types". Does the Count function in VFP support multiple parameters in determining whether a record is included in the count?.

My referece books only show a Count on one condition. Can you use complex conditions for inclusion (counting). For instance- in the following code, all of these variables and field names are dates except for the original case_type and the variable gn_CSP_tot.

Do I need to use parenthesis to use And's & Or's together like this?

COUNT ALL For case_type = "CSP" and
vol_with_no_response >= gd_start_date AND vol_with_no_response <= gd_start_date
OR vol_with_resolved >= gd_start_date AND vol_with_resolved <= gd_start_date
OR faxed >= gd_start_date AND faxed <= gd_start_date TO gn_CSP_tot

Any help would be greatly appreciated.

The 2nd mouse gets the cheese.
 
you need to nest the conditions ...
.or. (.... .and. ....) .or. (.... .and. ....) etc.
VFP can handle the complex conditions.

ramani
FoxAcc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top