Print Page | Close Window

Syntax in SQL union

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=6736
Printed Date: 31 March 2026 at 6:23pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Syntax in SQL union
Posted By: ngaisteve1
Subject: Syntax in SQL union
Date Posted: 26 October 2003 at 6:39pm
I think this question must be very simple for you guys but I just couldn't figure what wrong here.

sql = "Select * FROM maple WHERE type = '%"& strType &"%' UNION select * from asli WHERE type = '%"& strType &"%' order by date DESC "

Both maple and asli have type field.

Thanks.



Replies:
Posted By: pmormr
Date Posted: 26 October 2003 at 7:12pm
why are you using the modulus character (%) in your statement?

-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/


Posted By: ngaisteve1
Date Posted: 26 October 2003 at 7:25pm
I'm using ms access. That's wildcard.


Posted By: pmormr
Date Posted: 26 October 2003 at 7:33pm
you can't use a wild card in an equals statement. it's only valid when you use the 'LIKE' keyword.

-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/


Posted By: ngaisteve1
Date Posted: 26 October 2003 at 7:57pm
Oh, yes. I will try to change it. Thanks.


Posted By: ngaisteve1
Date Posted: 26 October 2003 at 8:25pm
Yes. You r right. Now, it works. Thanks.



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