Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extracting totals from an Option Group

Status
Not open for further replies.

rkcksk

Technical User
Jan 31, 2003
3
US
I am a new developer in the middle of my first application, so please excuse the basic questions.

I have created a form using several option groups (Bill Type Processed, Bill Type Corrected, Bill Resolution Method) to save on database fields. They work great. But, now I need to be able to sum how many choice # 1's, choice # 2's, choice # 3's I have each day on a report. I am having problems writing the expression (not as easy as just saying = sum (fieldname)).

Thank You.
 
Try this SQL in a query.

SELECT Count(TblTableName.Option) AS CountOfOption
FROM TblTableName
WHERE (((TblTableName.Option)="1"));
UNION
SELECT Count(TblTableName.Option) AS CountOfOption
FROM TblTableName
WHERE (((TblTableName.Option)="2"));
SELECT Count(TblTableName.Option) AS CountOfOption
FROM TblTableName
WHERE (((TblTableName.Option)="3"));

The values of the option groups are 1 for the first option, 2 for the second etc.

Hope this helps.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top