Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2011

    Unanswered: Count IDs and subtract

    I have a db that is designed to place trainees on events. I have built it so that a user can select the trainee, look at what events they need to attend and then select an event and place them on it. This works fine but what i need to do is subtract that from the places available on the particular event but I'm not sure how I can subtract just an ID form a number. Obviously the Id is an autonumber and the field that needs to be subtracted from is a number so I'm not sure if this is possible. Can anyone point me in the right direction please.


  2. #2
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    no you cannot rely on the vlaue of an autonumber column for any purpose outside the system. an autonumber column is their as a convenience for the developer to make each row unique.. it has no value outside the system and it should not be used outside the system. specifically its not analogous to an inovice number, GRN and so on.

    have a look at the count predicate (verb) in SQL

    its going to be something like
    select count(Trainee_ID) as NoOnCourse from CourseBookings
    where CourseID = blah
    and date = #04/15/2011#
    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