Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2009

    Unanswered: Yes or No Field Help

    I have two tables one to many relationship that I keep Phone card sales.
    The Parent table has (PhoneName, SerialNo, FaceValus and QtyinBook) some books has 50 phone cards and some has 100 and others may have 25 in each book. The other table I keep daily sales for each day and it has these fields (SaleDate, PhoneName, SerialNo, FaceValue TicketNo, SoldOut) The TicketNo is the field that tells me where we are in the book and the SoldOut field is Yes or No. What I want is for example a book that has 100 phone cards when the TicketNo reaches 100 I want the SoldOut field to be automatically populated to YES. I have a form that I use to enter the daily sales.


  2. #2
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    that doens't sound like normalised data.
    you are repeating 3 elements in both tables "PhoneName, SerialNo, FaceValue"

    depending on how your sales work or are booked you coudl easily enough sum the quantity sold from a specific book and compare that against the quantity in the book

    from what you have posted so far I'd probably look at 3 tables
    one table defines details of card types (including the quantity in that card type)
    details of cards on hand (eg details, date bought, serial no's etc..)
    details of sales

    the sold out is actaully a fucntion of the user interface, not something you actually store int he db.

    however its perfectly legitimate (assuming you can justify it) to store a sold out flag in the card details. such justification could include performance or business logic... but I don't think your needs as described so far merits such a violation of normalisation

    Fundamentals of Relational Database Design --
    The Relational Data Model, Normalisation and effective Database Design
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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