Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Apr 2002
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    query help (access 97)

    hi all,

    hope some1 can help. i know the criteria of how to update the cell data, but don't know exactly how to structure it in access. a newbie in access. here is an example of the table headings and values respectively...

    sku #,material code,quantity,cost
    1,2,1000,5.00
    1,3,25,10.00
    1,4,30,15.00
    2,2,2000,25.00
    2,3,200,35.00
    3,2,3000,12.00

    what i would like the query update to do is if material code = 2 & quantity = 2000, then i want all that sku's material code's code's cost divided by 2.

    therfore in the example all sku # 2's material cost is updated by dividing the current amount by 2.
    thanks for any suggestions on this.

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: query help (access 97)

    A couple of questions: is cost a per unit cost or the total cost, and if the code is 3 do you want to divide by 3, if 4 divide by 5, etc?

    The basic trick is to create a select query that has a criteria of 2 for the MaterialCode, and test that to make sure you are getting what you want. There change that to an update query, and set the update for the cost field to be Cost/2.
    Wendell

  3. #3
    Lounger
    Join Date
    Apr 2002
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: query help (access 97)

    Hi Wendell,

    Yes, the cost is a per unit cost, but no to the second question, if code is 3, I still want the cost divided by 2.

    Thanks for the tip. I'll try creating a select query.

Posting Permissions

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