Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Command contains unrecognized phrase/keyword
Message
From
24/12/2006 10:37:24
 
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:
01180047
Views:
18
hi,
i need to sum as
stk_code  m_1    m_2.... m_12
120004    4521   65214   569874&& m_1 or m_2 mean from 1/1/2006 to 31/1/2006..etc
1350002    657   6744   88875
.
.
.
>Mohammed,
>
>Change to
>
>WHERE between(trn_date,date(2006, 1, 1),date(2006, 12, 31))
>
>
>>hi,
>>thank you,
>>it try as under, but no result, i'm sure about data
>>
>>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
>>
>>tanks.
>>>>hi all,
>>>>i try this code it works for one time, i try again i get error message Command contains unrecognized phrase/keyword
>>>>
>>>>ldStart =ctod("01/01/2006")
>>>>ldEnd = ctod("31/12/2006")
>>>>
>>>>SELECT stk_code,trn_type ;
>>>>	SUM(IIF(MONTH(trn_date)=1 AND trn_type= 44, trn_qnty, 000000)) AS m1_t ;
>>>>	FROM test ;
>>>>WHERE between(trn_date,ldStart,ldEnd) ;
>>>>GROUP BY stk_code,trn_type
>>>>brow
>>>>
>>>>thanks
>>>
>>>Don't use ctod() to get date constants. This command is ambiguous - the result may depend on SET DATE and SET CENTURY.
>>>
>>>Instead, use one of the following:
>>>
>>>
>>>{^2006-12-31} && unambiguous date constant
>>>date(2006, 12, 31) && unambiguous date expression
>>>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform