Results 1 to 4 of 4

Thread: commas

  1. #1
    Join Date
    Mar 2006

    Unanswered: commas

    I am again having problems with these damned commas, they seem never to conform to my knowledge.I tried to convert the otherwise good and working update query into an sql but i got red colours showing that Access does not accept my commas.I tried with single commas ' or with double commas """" but obviously i jumbled the commas up with no result.Would you help me convert the update query below into an sql ?

    UPDATE products SET products.items5 = DLookUp("Diff","qryNetDiff","ProductID=" & [ProductID])
    WHERE (((products.Productid) In (SELECT ProductID FROM qryNetDiff)));

  2. #2
    Join Date
    Feb 2004
    One Flump in One Place
    UPDATE products 
    SET products.items5 = qryNetDiff.ProductID
    FROM products INNER JOIN qryNetDiff ON products.ProductID = qryNetDiff.ProductID;
    That should be more efficient ASSUMING your query does not render it non-updateable (e.g. if it has aggregates in it). BTW - those are called quotes\ double quotes (or apostrophes) not commas.


  3. #3
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    agree with poots, but fo the record...
    if you are getting confused (or the compiler/IDE is getting confused) consider using chr$(34) which returns the ascii character 34: "

  4. #4
    Join Date
    Nov 2007
    Adelaide, South Australia
    I just convert double quotes to single quotes and then enclose the whole thing in double quotes. It's worked for me every time

    "UPDATE products SET products.items5 = DLookUp('Diff','qryNetDiff','ProductID=' & [ProductID])
    WHERE (((products.Productid) In (SELECT ProductID FROM qryNetDiff)));"
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!

    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

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