Update Query Problem - won't update stock

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • LilKiwi
    New Member
    • Mar 2013
    • 1

    Update Query Problem - won't update stock

    Hi Guys,

    Im having problems with an update query :\ (Yes, its probably very simple )

    Im trying to update my stock for DVDs When customers have rented them out (minus 1 from stock) and returned them (add one back to stock).
    Also a customer can only have 2 DVDs out at a time.
    My update query for stock as follows...
    Field: Stock Update to: [Stock]-1
    Field: MovieReturned? Criteria: No
    Field: MovieReturned2? Or: No
    But everytime I try to update, it says updating 0 rows >.<

    Ive attached some pictures so you can see what it looks like.
  • zmbd
    Recognized Expert Moderator Expert
    • Mar 2012
    • 5501

    #2
    1) It is usually preferred that you not use attachments unless specifically asked for them. Well worded questions giving the detail of the goal, the exact errors, what is happening, the Code and SQL text posted (following the guidelines in the link provided in the following point #2) is the preferred method.

    2) Without the actual SQL it is hard to debug
    - What you should do is write the query as a standard "Select" query first so that you can determine that the correct records are being returned for update. Once that is done then converting to an update is a point and click away! We'll need to see your SQL at some-point. Please do not attach it, post it: >> Before Posting (VBA or SQL) Code.

    3) It sounds as your database is not normalized.
    [Z{<link pulled - Possible Malware>]
    Database Normalization and Table Structures. If your database was normalized:
    - for customers: all you would need do is query on the customer's id and return the count of records without a return date in a "circulatio ns" table. Unless you needed historical data this table could even be one that you add and delete the record from instead. Several ways to do this depending on DB design and requirements.
    - for stock: aggregate query against the circulation table and against an inventory table. Several ways to do this depending on DB design.

    4) There are no attachments - beware, most off-site upload services are not available for review by a majority of the Experts/Mods as we tend to use Company PC's. Please see the FAQ section for upload instructions.
    Last edited by zmbd; Mar 26 '13, 04:23 PM.

    Comment

    • Taaner
      New Member
      • Mar 2012
      • 16

      #3
      Z,
      I get following message when opening your link "A Tutorial for Access":

      The page you've been trying to access was blocked.

      Reason: Virus Detected! The page or file you requested is infected with the following virus: Trojan.JS.Ifram e.gen.
      Transaction ID is 5151B33C3779130 E8495.


      So maybe it is better to remove the link...

      Comment

      • Seth Schrock
        Recognized Expert Specialist
        • Dec 2010
        • 2965

        #4
        I'm not getting any error opening the link.

        Comment

        • Taaner
          New Member
          • Mar 2012
          • 16

          #5
          We have a sensitive protection here at the company.

          Maybe it is a false alarm but I don't have the tools here to check it out (yep, heavy security but have to use IE9 as browser).

          Comment

          • zmbd
            Recognized Expert Moderator Expert
            • Mar 2012
            • 5501

            #6
            That's very interesting.
            Normally any such junk is caught by my company's AntiVirus/Malware. It currently scans as clear.

            Which antivirus are you using?

            Comment

            • zmbd
              Recognized Expert Moderator Expert
              • Mar 2012
              • 5501

              #7
              I pulled the source code on that page.
              It looks like there was an attempt at an Iframe injection; however, the code is/was mangled.
              In any case, I'll pull the link until I can get in touch with the site's webmaster.

              Comment

              • Taaner
                New Member
                • Mar 2012
                • 16

                #8
                At our PC's is McAfee but I think the site was already blocked by the firewall in the datacenter.

                Maybe it is a false positive but it is good to inform the webmaster to check his site.

                Comment

                Working...