Trying to Calculate Fields

Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default Trying to Calculate Fields

    I am trying to create a course registration website and I need to show how many
    seats remain in a course. I am using Access 2000 and DWMX2004(ASP VBScript).
    Here are the tables I have setup up(Based the Event Management Project in
    Access): EventsTbl- EventID, AN EventName, TXT Status, TXT AvailableSpaces,
    Num RegistrationTbl- RegistrationID, AN AttendeeID, Num EventID, Num RegDate,
    Date AttendeesTbl- AttendeeID, AN AttendeeName, TXT DepartmentName, TXT I am
    not sure how to go about setting up a recordset to subtract the number of
    attendees from the number of available spaces. Thank you in advance for you
    help.

    Robjr17 Guest

  2. Similar Questions and Discussions

    1. Calculate on change
      I want to calculate a Total field by reading the Lettergrade and the Credit. I would like the fiield to calculate onchange routine. I need some...
    2. #26351 [Opn->Bgs]: Incorrect handling of Null Fields/Numerical Fields with '0'
      ID: 26351 Updated by: iliaa@php.net Reported By: jabberwocky at ibplanet dot com -Status: Open +Status: ...
    3. #26351 [NEW]: Incorrect handling of Null Fields/Numerical Fields with '0'
      From: jabberwocky at ibplanet dot com Operating system: Any PHP version: 4.3.4 PHP Bug Type: MSSQL related Bug description: ...
    4. Calculate Age from DOB
      I need a calculation that indicates how old (based on the DOB field) someone is in years /months/days. I'd be grateful for years and months only if...
    5. Calculate next available IP
      Is there a module, or a readily available algorithm, for calculating the next available IP Address? Let's say I have an array...
  3. #2

    Default Re: Trying to Calculate Fields

    Query the event table for the total number of seats available. Query
    the registration table and count the number of regID's for the event in
    question.

    Subtract the number of regID's from the available seats and display the
    results.

    I think it will be able to create two seperate recordsets and then code
    the calculation manually.

    Brett


    Robjr17 wrote:
    > I am trying to create a course registration website and I need to show how many
    > seats remain in a course. I am using Access 2000 and DWMX2004(ASP VBScript).
    > Here are the tables I have setup up(Based the Event Management Project in
    > Access): EventsTbl- EventID, AN EventName, TXT Status, TXT AvailableSpaces,
    > Num RegistrationTbl- RegistrationID, AN AttendeeID, Num EventID, Num RegDate,
    > Date AttendeesTbl- AttendeeID, AN AttendeeName, TXT DepartmentName, TXT I am
    > not sure how to go about setting up a recordset to subtract the number of
    > attendees from the number of available spaces. Thank you in advance for you
    > help.
    >
    Ba Work Guest

  4. #3

    Default Re: Trying to Calculate Fields

    I'd do the following:
    - first add a field to your EventsTbl, called TotalSeats or something
    like that, and which holds the number of available seats for the event
    - then do, for a given EventId where you want to compute the number of
    free seats:
    SELECT COUNT(*) AS NoOfAttendees FROM RegistrationTbl WHERE EventId =
    eventTobeTracked
    - save the result (NoOfAttendees) in a variable, then do:
    UPDATE EventsTbl SET AvailableSpaces = (TotalSeats - NoOfAttendees)
    WHERE EventID = eventTobeTracked

    But of course, the more clever method would be to subtract one
    AvailableSpaces from the corresponding row in the EventsTbl every time
    somebody register for an event, and check at the same time that
    Available Spaces is > 0...

    Robjr17 wrote:
    > I am trying to create a course registration website and I need to show how many
    > seats remain in a course. I am using Access 2000 and DWMX2004(ASP VBScript).
    > Here are the tables I have setup up(Based the Event Management Project in
    > Access): EventsTbl- EventID, AN EventName, TXT Status, TXT AvailableSpaces,
    > Num RegistrationTbl- RegistrationID, AN AttendeeID, Num EventID, Num RegDate,
    > Date AttendeesTbl- AttendeeID, AN AttendeeName, TXT DepartmentName, TXT I am
    > not sure how to go about setting up a recordset to subtract the number of
    > attendees from the number of available spaces. Thank you in advance for you
    > help.
    >
    bthouin Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139