Can you combine multiple functions into one with Access 2002 connected SQLServer

M

Mitchell_Collen

Can you combine multiple functions into one with Access 2002 connected to SQL
Server? If so, how?
Please let me know if this is the wrong group for this type of query.
I have 3 functions, they all take in the same parameter BETWEEN @Start AND
@End,
each function has different set of tables linked for different outcomes.

Because the naming conventions are so long I will use ,pseudocode, if you
will. Please help, I new to this.Please see below:

I'd like the counts to come out like:

EnteredbyTech ReviewedbyPharm EnteredbyPharm
2300 45030 3400

ALTER FUNCTION Pharmacy.TOT_ORDERS_PHARREV
(@Start datetime,
@End datetime)
RETURNS TABLE
AS

SELECT COUNT(dbo.phmOrderState.ReviewedBy) AS EnteredbyPharm
FROM dbo.phmVisit INNER JOIN "different tables to find only entered by
with pharmacist title...""
WHERE (dbo.phmOrderState.OrderStateTime BETWEEN @Start AND @End)

--after this select, I want to use the other three selects in same function
is this possible?

SELECT COUNT(dbo.phmOrderState.EnteredBy) AS EnteredbyTech
FROM dbo.phmVisit INNER JOIN "different tables to find only entered by
with tech title...""
WHERE (dbo.phmOrderState.OrderStateTime BETWEEN @Start AND @End)


SELECT COUNT(dbo.phmOrderState.EnteredBy) AS ReviewedbyPharm
FROM dbo.phmVisit INNER JOIN "different tables to find only pharmacist...
"
WHERE (dbo.phmOrderState.OrderStateTime BETWEEN @Start AND @End)


Thanks, MC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top