CREATE CURSOR mytable (Crimetype c(20), CrimeDate date) Count to JanCount for ; Alltrim(Crimetype) = "B&E Garage" and Month(CrimeDate)= 1 ; or Alltrim(Crimetype)= "B&E Home" and Month(CrimeDate)= 1 ; or Alltrim(Crimetype)= "Home invasion" and Month(CrimeDate)= 1 ; or Alltrim(Crimetype)= "B&E Business" and Month(CrimeDate)= 1 ; or Alltrim(Crimetype)= "B&E Cabin" and Month(CrimeDate)= 1 ? jancountHowever when you combine AND/OR conditions you shoud use parenthesisis to specify proper order as shown below.
Count to JanCount for ; (Alltrim(Crimetype) = "B&E Garage" and Month(CrimeDate)= 1) ; or (Alltrim(Crimetype)= "B&E Home" and Month(CrimeDate)= 1) ; or (Alltrim(Crimetype)= "Home invasion" and Month(CrimeDate)= 1) ; or (Alltrim(Crimetype)= "B&E Business" and Month(CrimeDate)= 1) ; or (Alltrim(Crimetype)= "B&E Cabin" and Month(CrimeDate)= 1)The conditions could be simplified as shown below
Count to JanCount for ; Alltrim(Crimetype) IN("B&E Garage", "B&E Home", "Home invasion", "B&E Business", "B&E Cabin" ) ; and Month(CrimeDate)= 1>When I test this bit of code, I get a 'missing operand' error.
>Count to JanCount for Alltrim(Crimetype) = "B&E Garage" and Month(CrimeDate)= 1 ; >or Alltrim(Crimetype)= "B&E Home" and Month(CrimeDate)= 1 ; >or Alltrim(Crimetype)= "Home invasion" and Month(CrimeDate)= 1 ; >or Alltrim(Crimetype)= "B&E Business" and Month(CrimeDate)= 1 ; >or Alltrim(Crimetype)= "B&E Cabin" and Month(CrimeDate)= 1 >