Original Post
Hello, Is it possible to assign things that return by COUNT into a variable? Let's say i have a table like this: table_1: And I wanted to see how many people in Group A and Group B in a table like this: table_2: I have no idea how to do this, in a quick and easy way. So i break it down into functions. Breaking into selecting Group A and B, then INSERT them into the table... But I am stuck at stage 1 [bawling] i have this: But I CAN'T... why? [dead] any way round it? [help] Help~~~ Thanks in advance [smile] (Oh, I forgot to say I'm using Foxpro 9...)
Name Group Grade Year
=============================================
Peter A A 2005
Marry A B 2005
Susan B A 2005
Carol B B 2005
Group A Group B
======================
2 2
FUNCTION myFunction(myGroup)
result = SELECT COUNT(*) FROM table_1 WHERE Group = 'A'
RETURN result
ENDFUNC