access - Update with nested select query

Ask a Question related to Databases, Design and Development.

  1. #1

    Default access - Update with nested select query

    Hi guys, will be brief cuz im stressed.this is access DB btw
    whats wrong with this update statement
    select statement work well on its own.
    design to update any records in accounts table with no date of issues after 2007 in mailing table. tells me only 1 record can be returned, if I use exist I get all records.THANKS

    UPDATE [Tbl Mailing Details] SET Lapsed = 1
    WHERE (SELECT [Tbl Quote Information].[Mailing ID]
    FROM [Tbl Quote Information] INNER JOIN [Tbl Mailing Details] ON [Tbl Quote Information].[Mailing ID] = [Tbl Mailing Details].[Mailing ID]
    GROUP BY [Tbl Quote Information].[Mailing ID]
    HAVING (((Max([Tbl Quote Information].[Date of Issue]))<#9/1/2007#)));
    Last edited by the_penfool; May 12th at 02:16 PM. Reason: access db
    the_penfool is offline Junior Member
    Join Date
    May 2011
    Posts
    2

  2. Similar Questions and Discussions

    1. update and insert query error, but select works ok.
      :rose; Any ideas spring to mind about the following issue? I'm getting an error trying to run an Update or Insert query. I can run a Select...
    2. SQL: nested select vs. two selects
      I have two tables. Items and ItemCategories. I want to pull up a list of all items that have a specific itemCateogryID from the Items table. I...
    3. Union or Join or Nested Select - Can't Remember
      Its been along time since I have had to write tsql from the hip so any help would be greatly valued. I have a table that contains Country, State,...
    4. trying to update a table after making a join select query on two tables
      here is my problem distilled down I need to be able to change the title of a book associated with an author there are 2 tables "author" and "books"...
    5. Use a SELECT @@IDENTITY as a sub-query in an UPDATE ?
      It didn't work. UPDATE tblBlogs SET link_ID = blog_ID WHERE blog_ID = @@IDENTITY I get this error when trying to save an Access query: ...
  3. #2

    Default Re: access - Update with nested select query

    may have fixed it by adding IN....


    UPDATE [Tbl Mailing Details] SET Lapsed = 1
    WHERE [Mailing ID] IN (SELECT [Tbl Quote Information].[Mailing ID]
    FROM [Tbl Quote Information] INNER JOIN [Tbl Mailing Details] ON [Tbl Quote Information].[Mailing ID] = [Tbl Mailing Details].[Mailing ID]
    GROUP BY [Tbl Quote Information].[Mailing ID]
    HAVING (((Max([Tbl Quote Information].[Date of Issue]))<#9/1/2007#)));
    the_penfool is offline Junior Member
    Join Date
    May 2011
    Posts
    2

  4. #3

    Default Re: access - Update with nested select query

    You need to put some condition in where clause like as you are fetching mailid from other tables then u can match mailid and put the condition like WHERE mailid in (SELECT....
    Ashish Singhal is offline Junior Member
    Join Date
    Sep 2011
    Posts
    3

  5. #4

    Default access - Update with nested select query

    Need a vehicle list that’s clean, simple and won’t cost you (or your client) hundreds of dollars to buy and maintain? Our ‘Full Size’ model is robust and highly functional, but doesn’t have the excessive number of fields that many users don’t want or need.
    year make model database
    shanonfields is offline Junior Member
    Join Date
    Mar 2012
    Location
    USA
    Posts
    1

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139