Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 SQL/ASP Help :: SOS ::
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Lycaster
New Member

USA
60 Posts

Posted - 19 April 2002 :  08:11:29  Show Profile  Visit Lycaster's Homepage  Send Lycaster an AOL message
I am attempting to retreive and display information relative to its
"product code". Below is an example of what I am doing. It is currently allowing me to see and display ONLY records in which a product code exists. My problem is that I also need to reference other relevant information for any record in which a product code DOES NOT exist, and am having trouble making the bind. Here is code I am using to get (only) the product code information:


If (Request("ProdID") <> "") Then

Set oData = Server.CreateObject("ADODB.Recordset")
oData.ActiveConnection = Application.Value("DSN")
oData.Source = "SELECT * FROM dbo.pd_final" & sPubID & " ORDER BY Mn_srt_ord ASC"
oData.CursorType = 0
oData.CursorLocation = 3
oData.LockType = 3
oData.Open()

sID = Trim(Request("ProdID"))
sFilter = "Pc_prd_cd = '" & sID & "'"
oData.Filter = sFilter

End If


Additionally the 'other' information relative to the same company is displaying in another recordset (by itself) like this:


If (Request("Company") <> "") Then

Set oData = Server.CreateObject("ADODB.Recordset")
oData.ActiveConnection = Application.Value("DSN")
oData.Source = "SELECT * FROM dbo.pd_final" & sPubID & " WHERE Mn_lst_cd = 'S' ORDER BY Mn_coname ASC"
oData.CursorType = 0
oData.CursorLocation = 3
oData.LockType = 3
oData.Open()

sCompany = Trim(Request("Company"))
sFilter = "Mn_acct LIKE '%" & sCompany & "%'"
oData.Filter = sFilter

End If


I dont know how to bring these together to allow me to filter by "product code" while also providing me the information I need on the company ("S"). I can only seem to get one or the other.

Can anyone help me?
Please?

Jared Wuliger
jared@oxcyon.com
www.oxcyon.com

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 19 April 2002 :  08:18:48  Show Profile  Send ruirib a Yahoo! Message
How can anyone help you without knowing the structure of the Products table, the Company table and the relationship between both?

-------------------------------------------------
Installation Guide | Do's and Dont's | MODs
Go to Top of Page

Bunce
New Member

Australia
84 Posts

Posted - 20 April 2002 :  05:17:38  Show Profile  Send Bunce an ICQ Message
Combine your two recordsets into one, and look into an OUTER Join.

Cheers,

Andrew

======================================================
There have been many, many forum posts made throughout the world...
This was one of them!
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 20 April 2002 :  06:01:07  Show Profile  Send ruirib a Yahoo! Message
quote:

Combine your two recordsets into one, and look into an OUTER Join.


It doesn't look like he knows the syntax for an Outer Join, and you need to know how the tables involved are related, to help him...

-------------------------------------------------
Installation Guide | Do's and Dont's | MODs
Go to Top of Page

Bunce
New Member

Australia
84 Posts

Posted - 21 April 2002 :  00:29:10  Show Profile  Send Bunce an ICQ Message
True.

Its just that I had a very similar problem last week (although a little more complicated):
http://www.sqlteam.com/Forums/topic.asp?TOPIC_ID=14801
http://www.aspmessageboard.com/forum/databases.asp?M=390211&T=390211&F=21&P=1

May help...


======================================================
There have been many, many forum posts made throughout the world...
This was one of them!
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.22 seconds. Powered By: Snitz Forums 2000 Version 3.4.07