Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Command contains unrecognized phrase/keyword
Message
From
24/12/2006 09:50:23
Suhas Hegde
Dental Surgeon
Sirsi, India
 
 
To
24/12/2006 09:35:55
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01180003
Message ID:
01180033
Views:
19
>
>CLOSE ALL
>USE test
>brow&&i can see my data(found)
>ldStart =ctod("01/01/2006")
>ldEnd = ctod("31/12/2006")
>
>SELECT stk_code,trn_type,trn_date,cst_prce,str_nmbr, ;
>	SUM(IIF(MONTH(trn_date)=1 AND trn_type=1,trn_qnty, 000000)) AS m1_t ;
>	FROM test ;
>WHERE between(trn_date,ldStart,ldEnd)&&no result
>WHERE between(trn_date,date(2006, 12, 31))  ;error
>GROUP BY stk_code,trn_type,trn_date,cst_prce,str_nmbr
>
trn_date = ??? is it defined ?

try shifting the iif outside the sum like

SELECT stk_code,trn_type,trn_date,cst_prce,str_nmbr, ;
SUM(trn_qnty) AS m1_t ;
FROM test ;
WHERE MONTH(trn_date)=1 AND trn_type=1 and between(trn_date,ldStart,ldEnd) ;
GROUP BY stk_code,trn_type,trn_date,cst_prce,str_nmbr

also does TRN_QNTY have null values ?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform