If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Can you combine multiple functions into one with Access 2002 connected SQLServer
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 -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...eries/200705/1 |
#2
|
|||
|
|||
Can you combine multiple functions into one with Access 2002 connected SQLServer
|
Thread Tools | |
Display Modes | |
|
|