CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 more than one record count

Print topic Send  topic

Author Message
beer-monkey.com
Posted: 07/04/2002, 3:51 AM

I have a grid on my page containing the following custom SQL to display a count:

SELECT count(vacancy_id) as vacancies_total
FROM dev_vacancies,dev_contact
WHERE dev_vacancies.branch_number = dev_contact.contact_id

I would also like on the same form the following two counts:

SELECT count(vacancy_id) as vacancies_total
FROM dev_vacancies,dev_contact
WHERE dev_vacancies.branch_number = dev_contact.contact_id AND
dev_vacancies.approved = 0

SELECT count(vacancy_id) as vacancies_total
FROM dev_vacancies,dev_contact
WHERE dev_vacancies.branch_number = dev_contact.contact_id AND
dev_vacancies.approved = 1

How might I do this? Do i need three forms , one for each total i require?

thanks in advance
Chris K.
Posted: 07/04/2002, 9:51 AM

In CC:
Create menu instead of grids. Add three items, rename as wanted and write BeforeShow event to display counts as menu items. Calculate them using DLookup function:

fldCount1 = "Approved: " & Dlookup("dev_vacancies LEFT JOIN dev_contact ON branch_number = contact_id","count(vacancy_id)","approved = 1")

and similarly for other counts.

In CCS:
Put labels on the page and assign values to them using their BeforeShow event. (beware different arguments order in CCDLookup).

Count1.Value = "Approved: " & CCDlookup("count(vacancy_id)","dev_vacancies LEFT JOIN dev_contact ON branch_number = contact_id","approved = 1")

Good Luck,
Chris

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.