Results 1 to 2 of 2
  1. #1
    Marijn is offline Novice
    Windows Vista Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    1

    Insert a select SQL into a Update SQL statement

    Hi,



    Im quite new at SQL and im having a bit of trouble inserting one SQL query into another.

    I hope you can help me out.

    I am using a select query in this update statement

    DoCmd.RunSQL "UPDATE hlpqry_replace_maand_UWQ INNER JOIN tbl_UWQ ON hlpqry_replace_maand_UWQ.Brondocumentnummer = tbl_UWQ.Brondocumentnummer SET tbl_UWQ.[Datum eBS] = [hlpqry_replace_maand_UWQ].[Datum eBS3];"

    The SQL for the "hlpqry_replace_maand_UWQ" is:
    SELECT tbl_UWQ.Brondocumentnummer, Replace([Geplande begindatum],"MAR","MAAR") AS [Datum eBS1], Replace([Datum eBS1],"MAY","MEI") AS [Datum eBS2], Replace([Datum eBS2],"OCT","OKT") AS [Datum eBS3] FROM tbl_UWQ;

    Can I place the hlpqry SQL into the update statement?

    Thanks.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    Dont run these as SQL.
    built queries from them, and they should work.

    (the easy way)

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 03-07-2014, 09:40 PM
  2. INSERT statement
    By GraeagleBill in forum Programming
    Replies: 2
    Last Post: 03-29-2013, 12:53 PM
  3. Replies: 6
    Last Post: 03-09-2013, 10:44 AM
  4. Insert Into statement
    By TimMoffy in forum Programming
    Replies: 7
    Last Post: 07-13-2012, 07:10 AM
  5. Insert statement
    By crowegreg in forum Programming
    Replies: 2
    Last Post: 08-19-2011, 02:20 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums