CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Join Problem

  1. #1
    Join Date
    Aug 2000
    Location
    Essex, Uk
    Posts
    1,214

    Join Problem

    HI All,

    I am trying to join 2 tables in a select clause where the primary key of the master is say

    123456

    and the secondary table has a column (not the primary column) where it is made up of the form

    RDS123456A Where 123456 corresponds to the primary key of the Master.

    I thought that joining using

    t1.Key innerJOIN
    dbo.RPA_DAT rp ON substring(rp.DAT, 4, 6)

    but SQL Server doesn't like it

  2. #2
    Join Date
    Jan 2003
    Location
    North Carolina
    Posts
    309
    Are all the records primary key 6 in length and if not do you pad in the other table? Also what is the error you are getting?

  3. #3
    Join Date
    Aug 2000
    Location
    Essex, Uk
    Posts
    1,214
    Thanks for looking, I have managed to resolve this. Part of the prob was that I needed to perform a Cast on one of the columns.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured