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
|
|
|
 |
|