A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

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



 
 
Thread Tools Display Modes
  #1  
Old May 17th, 2007, 09:57 PM posted to microsoft.public.access.queries
Mitchell_Collen
external usenet poster
 
Posts: 5
Default 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  
Old May 18th, 2007, 02:22 PM posted to microsoft.public.access.queries
Mitchell_Collen via AccessMonster.com
external usenet poster
 
Posts: 58
Default Can you combine multiple functions into one with Access 2002 connected SQLServer

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:40 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.