Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select and sum
Message
 
 
To
19/06/2005 14:51:02
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 8
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01024603
Message ID:
01024714
Views:
15
You cannot compare date field 'dat' with character strings ("01/01/2005") AND ("31/12/2005"). They have to be the date constants or variables.

>i change it but i get error message
>Operator/operand type mismatch
>
>SELECT divi, mac1, ;
>	SUM(IIF(MONTH(dat)=1 AND typ = 1, INT(CTOT(true) - CTOT("00:00")), 000000)) AS m1_m, ;
>	SUM(IIF(MONTH(dat)=1 AND typ = 2, INT(CTOT(true) - CTOT("00:00")), 000000)) AS m1_a, ;	
>	SUM(IIF(MONTH(dat)=2 AND typ = 1, INT(CTOT(true) - CTOT("00:00")), 000000)) AS m2_m, ;
>	SUM(IIF(MONTH(dat)=2 AND typ = 2, INT(CTOT(true) - CTOT("00:00")), 000000)) AS m2_a ;	
>FROM table1 ;
>WHERE dat BETWEEN ("01/01/2005") AND ("31/12/2005") ;
>GROUP BY 1,2
>? m1_m,m1_a
>? m2_m,m2_a
>
>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform