problem with sql qurery

Discussion in 'Databases' started by tintumon, Apr 10, 2010.

  1. #1
    Hello all, im trying to execute the following:

    SELECT * FROM BasketDetails b
    INNER JOIN DesignDetails d ON b.CustomisedID = d.DesignID INNER JOIN Products p ON d.ProductID = p.ProductID INNER JOIN AffiliateMarkupPrice am ON am.DocumentID = d.DocumentID
    WHERE b.UserID = gnrac055rnj3x555jfwakt45 AND b.CheckoutID = 0

    Hwever, when I execute, I get the following error:

    "invalid column name 'gnrac055rnj3x555jfwakt45'"

    Any ideas?
     
    tintumon, Apr 10, 2010 IP
  2. koko5

    koko5 Active Member

    Messages:
    394
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    70
    #2
    Strings should be passed around quotes otherwise these are treated as column names. However, UserID seems to be Integer instead (so you'll get an empty result set, but no errors ) .
    Regards :)
     
    koko5, Apr 10, 2010 IP