Starting Database

B

Bill

Can someone help me out in creating my database? I am very new to working in
Access and am trying to learn as I go. The following is what I am hoping to
make.

I want to create a Pick3 Lottery Database. The fields that I need are:
Date (date of drawing),
Weekday (day of the week)
Drawing (midday or evening or bonus)
1st Number (first number drawn)
2nd Number (second number drawn)
3rd Number (third number drawn)

Now my question is how I can set up my table or tables. Would it be better
to have a separate table for each field or just one table? Also is there any
special formatting I need to do, so my Tables are set up correctly.
Some Queries I will have when Tables are finished:
1st Number drawn on any Thursday for Midday drawing
All three numbers drawn on certain date
How many times a number was drawn in specified time frame

There are many other relationships and queries I have, but this should give
you an idea of what I am attempting to do. I looked for something similar in
structure of what I am trying to do, but could not find anything. If anyone
knows of tables or forms I can look at would also help me.
Thanks,
Bill
 
K

Klatuu

The fields you have listed should all be in one table. Since there may be
more than one drawing on a date, you can't use that as the primary key. You
would need either an Autonumber field as the primary key or you could use a
composite primary key that would be the date and the drawing. I would also
suggest you consider adding Lottery field to tell you who the drawing is for.
For example, in Texas, we have Mega Millions and the Texas Lottery, so you
may want to be able to track multiple lotteries. If so, you would need an
additional field in your main table. It should be a Long Integer and it
should be used as a surrogate key for a new Lottery table that would have an
autonumber primary key to relate it to the Lotttery table using the surrogate
field. Also, I would expand the drawn numbers field to 6, with one bing the
kicker number. That is, for example in Power Ball, there is a number that is
different from the others and could be a duplicate of one of the other 5.

There is one field you do not need. That is the Weekday. It is easy to
calculate and since all you need to calculate and display the week day is a
simple expression.

= WeekDayName(Weekday([DrawingDate]))

Also, change the name of the field named Date. Date is an Access reserved
word because it is the name of a function and I have seen Access get confused
over whether you are using the name of a field or the function.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top