Print Page | Close Window

Between Dates in 2 tables

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=2915
Printed Date: 29 March 2026 at 10:14am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Between Dates in 2 tables
Posted By: Scotty32
Subject: Between Dates in 2 tables
Date Posted: 21 May 2003 at 8:58am

ok, i wanna show all records between 2 dates, it works ok and that, but now i need it to also show records from another table as well, i have no idea wot am doin, but am sure sumone can point in me the right direction *prays and hopes*

heres wot i tried:

sql = "SELECT Table1.*, Table2.* FROM Table1, Table2 WHERE Table1.Field BETWEEN #" & DateFrom & "# AND #" & DateTo & "# OR Table2.Feild BETWEEN #" & DateFrom & "# AND #" & DateTo & "# ORDER BY Table1.Field, Table2.Field DESC"

have i dont sumfin wrong? or is this a very pathetic attempt?

any code/links will be very helpfull




Replies:
Posted By: ljamal
Date Posted: 21 May 2003 at 11:24am
If Access supports unions you could try to join the tables together with a union. The format is

select fields from table where ....
UNION
select fields from table2 where ...

You have to specify the name of the fields in the first select statement and the number of fields select in both statements have to match.

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

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



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