Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 UNION Returns Nothing

Author  Topic 

taylo
Yak Posting Veteran

82 Posts

Posted - 2001-02-28 : 00:08:38
I apologize for the double post but I was not clear in my last post. This database has about 5 tables that should be purged in to 1 but at this time I can not. I am trying to "UNION" together the results from 2 tables like this in an ASP page.


Select DrugName from Primary_Drug_Table Where Left(DrugName,"&dnameL&") LIKE '%"&dname&"%' UNION
Select GenericName from Generic_Drug_Table Where Left(GenericName,"&dnameL&") LIKE '%"&dname&"%'
set rs = DataConn.execute(SQL)

But the query returns nothing. This is an Access database (unfortunately). Both of the fields (DrugName and GenericName) are text fields with a length of 100. It returns absolutely nothing. I can pull records with the single queries but once I UNION them, I get nothing.

Clueless in Rochester.


Rob

   

- Advertisement -