I'm building a table to store revenue and units sold data for
products. What's the best design for storing the dates? Having 13
fields (year, Jan, Feb...Dec) or having 2 fields (year, month)?
It would seem that 13 fields is ok since that's a constant, but I'm
not sure.
-John 5 1402
Separate records identified by product, year, and month is consistent with
good relational database design practices, and far more flexible for work
you will want to do later.
Larry Linson
Microsoft Access MVP
"John" <so*********@hotmail.com> wrote in message
news:90**************************@posting.google.c om... I'm building a table to store revenue and units sold data for products. What's the best design for storing the dates? Having 13 fields (year, Jan, Feb...Dec) or having 2 fields (year, month)?
It would seem that 13 fields is ok since that's a constant, but I'm not sure.
-John so*********@hotmail.com (John) wrote in
news:90**************************@posting.google.c om: I'm building a table to store revenue and units sold data for products. What's the best design for storing the dates? Having 13 fields (year, Jan, Feb...Dec) or having 2 fields (year, month)?
It would seem that 13 fields is ok since that's a constant, but I'm not sure.
-John
The second method will allow you to easily build queries that do
things like compare the last 6 months of last year to the first 6
months of this year. If you later decide you want to see 9 and 3,
it's a simple task to change the one parameter. With the 13 fields,
it's a whole new, complicated set of calculations.
Go with the 2 fields design.
Bob
Thanks for your advice Bob and Larry. Ironically, I had originally
designed the table with the fewer fields option...but alas, delerium
set in.
Bob Quintal <bq******@generation.net> wrote in message news:<b9******************************@news.terane ws.com>... so*********@hotmail.com (John) wrote in news:90**************************@posting.google.c om:
I'm building a table to store revenue and units sold data for products. What's the best design for storing the dates? Having 13 fields (year, Jan, Feb...Dec) or having 2 fields (year, month)?
It would seem that 13 fields is ok since that's a constant, but I'm not sure.
-John
The second method will allow you to easily build queries that do things like compare the last 6 months of last year to the first 6 months of this year. If you later decide you want to see 9 and 3, it's a simple task to change the one parameter. With the 13 fields, it's a whole new, complicated set of calculations.
Go with the 2 fields design.
Bob
One last question;
I have two fields, year and month. Should these be integer data types
or date/time? If date/time, how would I create an input mask to make
relevant limits?
Thanks...
Bob Quintal <bq******@generation.net> wrote in message news:<b9******************************@news.terane ws.com>... so*********@hotmail.com (John) wrote in news:90**************************@posting.google.c om:
I'm building a table to store revenue and units sold data for products. What's the best design for storing the dates? Having 13 fields (year, Jan, Feb...Dec) or having 2 fields (year, month)?
It would seem that 13 fields is ok since that's a constant, but I'm not sure.
-John
The second method will allow you to easily build queries that do things like compare the last 6 months of last year to the first 6 months of this year. If you later decide you want to see 9 and 3, it's a simple task to change the one parameter. With the 13 fields, it's a whole new, complicated set of calculations.
Go with the 2 fields design.
Bob so*********@hotmail.com (John) wrote in message news:<90**************************@posting.google. com>... One last question;
I have two fields, year and month. Should these be integer data types or date/time? If date/time, how would I create an input mask to make relevant limits?
Thanks...
I would make year an integer and month a byte. For month, you could
have a validation rule of "between 1 and 12". This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Millie Niss |
last post by:
I am new to PHP and mySQL, and I am trying to build a database of
services (on a service table) provided by agencies (another table),
where one agency can provide many services, but a service...
|
by: Jim |
last post by:
For some reason the compiler is telling me that I must declarethe
variable @costcenter_tmp on lines 74 and 98...but if i put a select
statement in ther (for testing) before the loop I get data back...
|
by: Laura Stout |
last post by:
Please help! I've been spinning my wheels on this one! I am working on
a database that tracks future project opportunities. For each
opportunity, the data entered includes total project value and...
|
by: Hanif Merali |
last post by:
Hello,
I'm having some difficulties creating a make table query. The source
table which I'm basing the make table query has the fields:
CIF
BusLine1-2001
BusLine1-2002
BusLine1-2003...
|
by: JayDawg |
last post by:
Is there any way to create a pivot table in a report? I have a query
with the fields Date, Name, and Data, and I am trying to create a
report that has the dates running across the top (like...
|
by: keri |
last post by:
Hi everyone,
Having learnt a little about the basics whilst creating my first db I
am now about to start creating a good one!
I am about to sit down with a large piece of paper and plan it all...
|
by: wrldruler |
last post by:
Hello,
First, I know it's against "Access Law" to save calculations in a
table, but....I want/need to.
I currently have sub-totals being calculated inside a form, using
DMax, DCount, and...
|
by: Newbie12345 |
last post by:
I have a crosstab query which gathers data from a regular table and creates columns for the months in the year with volume for each month. I want to be able export/send the data to a brand new table,...
|
by: benchpolo |
last post by:
Tablename: CLAIMS
Fields: PATID, REVENUE, CLAIMNO
DATA
235101133A, 6117.84, 200705455201111
235101133A, 6117.84, 200605599902888
Question?
I have a set of data records where the REVENUE...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |