Results 1 to 4 of 4

Thread: Update Query

  1. #1
    Join Date
    Jan 2003
    Location
    Guelph, Canada
    Posts
    39

    Unanswered: Update Query

    I have a table with fields that include [checkbox] results and [DetID]
    numbers.
    I would like to run an update query to look for checked records and
    then take the corresponding DetID's that will match up with DetID's in
    QueryB.
    For these records in the QueryB, I'd like to increase the Serve field
    by 1.

    Help in accomplishing this would be greatly appreciated!

    TIA Eric

  2. #2
    Join Date
    Feb 2003
    Posts
    27

    Re: Update Query

    update queryB
    set serve = serve + 1
    from queryb join table1
    on queryb.DetID = table1.DetID
    where table1.<checkboxfieldname>.[select] = true

  3. #3
    Join Date
    Jan 2003
    Location
    Guelph, Canada
    Posts
    39
    Thanks very much Newbie for your reply!

    I input your code:

    UPDATE [BethDateSorted]
    SET Served = Served+1
    FROM BethDateSorted JOIN StudentCheck
    ON BethDateSorted.DetentionID = StudentCheck.DetentionID
    WHERE StudentCheck.Checkbox = True

    But I get an error message saying:
    Syntax error (missing operator) in query expression

    'Served+1
    FROM BethDateSorted JOIN StudentCheck
    ON BethDateSorted.DetentionID = StudentCheck.DetentionID'

    and the word FROM is highlighted.

    Any ideas what might be the problem?

    TIA Eric

  4. #4
    Join Date
    Feb 2003
    Posts
    27
    try this

    UPDATE [BethDateSorted]
    SET Served = Served+1
    FROM BethDateSorted JOIN StudentCheck
    ON BethDateSorted.DetentionID = StudentCheck.DetentionID
    WHERE StudentCheck.Checkbox.[select] = True

Posting Permissions

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