Print Page | Close Window

ADO Sort Data from 2 tables together

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=10761
Printed Date: 31 March 2026 at 3:01pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: ADO Sort Data from 2 tables together
Posted By: Diddl
Subject: ADO Sort Data from 2 tables together
Date Posted: 06 June 2004 at 1:00pm

Hi

I'm maintaining a Movie release list on my site, and wanted to include books on the list. The problem is that the information is located in different tables. I'm using ADO connection, and want to know how i can Order the information by Release Date together, and then write it on my website.




Replies:
Posted By: ljamal
Date Posted: 06 June 2004 at 2:05pm
use the union clause

select moviename, releasedate from movie
UNION
select bookname, releasedate from books
order by release

to UNION 2 or more queries they need to return the smae number of columns (2 in the example above). The columns will take the names of the columns from the first query (moviename & releasedate from the example above)

-------------
L. Jamal Walton

http://www.ljamal.com/" rel="nofollow - L. Jamal Inc : Web/ Print Design and ASP Programming


Posted By: Diddl
Date Posted: 12 June 2004 at 10:38am
Okay - thanks, i'll try that.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net