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 2008 Forums
 Transact-SQL (2008)
 Joining 2 Queries using Union Fails

Author  Topic 

Tava
Starting Member

3 Posts

Posted - 2010-11-22 : 05:12:56
Hi All,

I need to know if the below is possible, just not sure if i can do this due to the columns and data types. I currently have 2 scripts which work how i want seperatly but i would like to make it all as one script for simplicity.Ive been reading a Union All needs to be done which i tried but failed...

I have 4 columns in each script and 3 of these columns match exactly except the last column in script is a text value while the other is a numeric value.


Is there anyway around this or must i somehow fix the last column first?

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2010-11-22 : 05:32:23
You should convert the last column so that it's the same data type in both queries.

--
Gail Shaw
SQL Server MVP
Go to Top of Page
   

- Advertisement -