Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Missing operand (apparently)
Message
De
31/12/2006 15:22:51
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01181122
Message ID:
01181124
Vues:
11
>Hi Grady,
>
>I don't get any errors with your code as shown below.
>
>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
>
>? jancount
>
>However 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.
>>I can't see it. Can you?
>>
>>
>>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
>>
Thanks for the feedback Sergey. I'll kick my computer a few times and see if that will fix it. :=) I'll also change the code. Thanks sir.
I ain't skeert of nuttin eh?
Yikes! What was that?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform