Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sum and count
Message
 
 
To
02/02/2011 13:30:13
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01498370
Message ID:
01498375
Views:
37
>hi all,
>i get result from table mucurtw as ex..
>
>empnam,empno, typ1,total_cfil
>a       1     20    1
>a       1     20    3 
>a       1     20    1
>a       1     20    2
>a       1     18    10 
>a       1     18    32
>b
>b
>c
>c
>..
>..
>***********************
>i need result from table mucurtw to new table or cursor sum typ1 and count typ1 it all fields is CHR type as..
>empnam,empno, typ1,newtotal_cfil,count1
>a      1      20      7            4
>a      1      18      42           2
>.
>.
>
>
>thanks
>thanks

Try:
select EmpName, EmpNo, typ1, sum((cast Total_cFil as int)) as NewTotal_cFil, count(Total_cFil) as Count1 ;
from mucurtw ;
group by EmpName, EmpNo, typ1
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform