stnkyminky
Programmer
I read the posts at thread183-731431, but I don't really understand the problem.
I have a udf call fn_Split2 that accepts a INT. The function returns a table (key,value).
I'm attempting to the do following:
tblReqLog - contain information about a literature request
tblReqProd - contains references to the products made with the request.
tblRepZip - contains information about a Rep's area of responsiblity and the products they provide
Ex.
As you can see I'm trying to determine all the reps that are in the requestors area and provides the products that the requestor is interested in.
This was my attempt to gather that data in one query. I'm new to creating UDF's, so please be gentile in you explanation.
If anyone can provide a better way of accomplishing this
please feel free to share....
Thanks
Scott
Programmer Analyst
<{{><
I have a udf call fn_Split2 that accepts a INT. The function returns a table (key,value).
I'm attempting to the do following:
Code:
select distinct rl.Log_ID
from tblReqLog rl
inner join tblReqProd rp
on rp.LogID = rl.Log_ID
inner join tblRepZip_fg rz
on rz.zipCode=149 [COLOR=green]/*This will reference the requestors zip code */[/color]
where rz.product in (select value from fn_split2(Log_ID))
tblReqLog - contain information about a literature request
tblReqProd - contains references to the products made with the request.
tblRepZip - contains information about a Rep's area of responsiblity and the products they provide
Ex.
Code:
zipcode | RepCode | Products
----------------------------
242 | Rep001 | 1
242 | Rep001 | 2
242 | Rep001 | 3
242 | Rep002 | 1
242 | Rep002 | 2
As you can see I'm trying to determine all the reps that are in the requestors area and provides the products that the requestor is interested in.
This was my attempt to gather that data in one query. I'm new to creating UDF's, so please be gentile in you explanation.
If anyone can provide a better way of accomplishing this
please feel free to share....
Thanks
Scott
Programmer Analyst
<{{><