Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Using data retrieved from a join

Guest
Oct 22, 2007 Oct 22, 2007
I have a JOIN that returns a column from a table outside of the defined recordset. I want to display the column data but not be forced to also create the column in the recordset table. Is there a way to create a variable so I can use the data in my form and also pass in an URL, etc?
TOPICS
Server side applications
290
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 23, 2007 Oct 23, 2007
I'd love to see the SQL you're talking about as I don't understand what
you mean by "outside of the defined recordset"

Paul Davis
http://www.kaosweaver.com/
Visit us for dozens of useful Dreamweaver Extensions.

http://www.communitymx.com/
Partner at Community MX - Extend your knowledge

davidbarrackphoto wrote:
> I have a JOIN that returns a column from a table outside of the defined
> recordset. I want to display the column data but not be forced to also create
> the column in the recordset table. Is there a way to create a variable so I
> can use the data in my form and also pass in an URL, etc?
>
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 24, 2007 Oct 24, 2007
LATEST
Do you mean a UNION ALL statement where you combine data from two tables in the same database?

In ASP/SQL, that would look like this:

<%
set rs = Server.CreateObject("ADODB.Recordset")
rs.ActiveConnection = MM_connectionname_STRING
rs.Source = "SELECT id, variable1, variable2, variable3 FROM DatabaseTable1 WHERE Blah Blah Blah UNION ALL SELECT id, variable1, variable2, variable3 FROM DatabaseTable2 WHERE Blah Blah Blah"
rs.CursorType = 0
rs.CursorLocation = 2
rs.LockType = 3
rs.Open()
rs_numRows = 0
%>

This will combine records from both tables and give you results. You use one recordset to do it. Keep in mind, you have to list all the variables you want to pull (no *)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines