data type nvarchar and varchar are incopatible in the boolean and operator

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Anthony97
    New Member
    • Aug 2009
    • 24

    data type nvarchar and varchar are incopatible in the boolean and operator

    I'm trying to convert a query from access to sql server


    UPDATE [Shipments]
    SET [Shipments].[TCM Route Id] = LTrim([sfpostal/zip code]) & 'to' & LTrim([st postal/zip code])
    FROM [Shipments]
    WHERE ((([Shipments].[Route Id]) Is Null Or ([Shipments].[Route Id]) Like Null));

    this code works fine in access but will not run in sql server. I'm at a loss.
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    To concatenate two strings, just use the add operator (+). So it should be

    Code:
    LTrim([sfpostal/zip code]) + 'to' + LTrim([st postal/zip code])
    Happy Coding!!!

    ~~ CK

    Comment

    Working...