help in T-SQL

  • I am supposed to create a join condition between two tables.

    1) This one with nvarchar data type and has real number like ...9944156

    2) This one is varchar and has the same field with zeros added up in from so it becomes 10 char..

    for instance the same field shown in (1) becomes 0009944156.

    How can I compare these two to make it a.order_no=b.order_no

    There is no other field to really use in the join condition. Please help

    thanks

    Su

  • on convert(int,nvarfield) = convert(int,varfield)

    one way it could be done

  • Please don't cross post. It just wastes peoples time and fragments replies.

    No replies to this thread please. Direct replies to: http://www.sqlservercentral.com/Forums/Topic750235-391-1.aspx

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • I didn't mean to cross post, I was getting an error while posting my question, I thought it was not posted so I kep posting it, just realized that it has appeared everywhere... Sorry..

    Please post ur reply @ http://www.sqlservercentral.com/Forums/Topic750235-391-1.aspx

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply