SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Incorrect Joining Maybe???
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

cobby1812
Starting Member

United Kingdom
15 Posts

Posted - 06/11/2012 :  06:04:27  Show Profile  Reply with Quote
Hi there,

I have a Table called NO2. In there I have a field called Date
Date is a nchar(6) and looks thus 12160 - in simple terms it is broken down as 12 (being the year) and 160 (being the days from 1st Jan till today)

I created another table called Dates, in there I have nchar(6) field to match the files one and a smalldatetime field showing the date in 103 format.

When I try and link the tow together nothing returns.

i.e
SELECT * FROM NO2
LEFT OUTER JOIN DATES
ON NO2.DATE = DATES.DATESTRING
I have tried Inner and Outer etc. What am I doing wrong.

webfred
Flowing Fount of Yak Knowledge

Germany
8529 Posts

Posted - 06/11/2012 :  06:34:16  Show Profile  Visit webfred's Homepage  Reply with Quote
Don't know.
Have a look at the data, maybe in one table the column has leading space and the other one has trailing space?


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000