How do I keep a runing total?
I have a form that users use to sign in.
It's only a single table with six columes. This table will be used to track the number of people that sign up to for an event some kind of RSVP stuff.
Here is the table:
CREATE TABLE [dbo].[evite] (
[empId] [int] IDENTITY (1, 1) NOT NULL ,
[fname] [varchar] (25) NOT NULL ,
[lname] [varchar] (25) NOT NULL ,
[adults] [int] NOT NULL ,
[under_five] [int] NULL ,
[five_eight] [int] NULL ,
[nine_thirteen] [int] NULL
) ON [PRIMARY]
What I want to do is keep a running total. That is, when each invitee register, the total increments. So I can easily look up the total number of Adults, under_five, five_eight etc, that will be attending.
Yes, this is a test of a larger application, but if it works on one table, it should work.
Just one table with adults for one row, children for another etc. The idea is to keep a running total of potential attendees.
This sound like what I need!
On another topic, why don't you like Mysql? The issues you raised on the link are mostly addressed in V4.00?
By the way, does Sybase have a GUI tool to visualize what I am doing if choose to use Sybase?
I can do command line etc, but I also like tools that I can visualize.
Ok, an adult logs in by entering his or her firstname, then a lastname.
Then on another form field, how many children under 5,
then another field 9-12 etc.
The idea is to keep a tally of each age group that will be attending.
I did not see any need to have a different table for children since children can not attend without an adult and the names of the children is not being gathered. Only the number that each adult will be bringing to the party.
You are right and I thought about doing just that but when I read the requirements (I did not write it) it clearly says it's only one party (a weding). Since you can only have one weding at a time on any given day for any one person, I just put the attendees in one table and since the kids can only attend if their parents do and their names (kids) is not recorded, it did not make much sense to me gathering data that will not be used. So the event id should've been named wedindId??
I am wrong?
...only have one wedding at a time on any given day for any one person...
Yep, but the person (with firstname & lastname) in the table evite (or, in my model, people) isn't the bride/bridegroom - correct? So, you still need a reference to the event/wedding.
And there will be more than one event/wedding in the db I guess?
And, no, you don't have to record the names of the children etc, that's why the people_signed_up_for_events table still has the columns adults, under_five etc. The table people will only contain the "commander" for each group of attendees