views:

44

answers:

3

Hi,

I'm working on a project which generate report every quarter. So there is a table supporting this:

Report: ID(int) Quarter(byte)

...

But later, the requirement changed and need the system to support more then one report in the quarter like this: 2-1, 3-2, ...

How can I support this requirement change? Thanks in advance!

A: 

not sure why you use byte for quarter and dont have a year column. Byte holds 256 different values, enough for four quarters, okay.

I'd do the following: Year(int) Quarter(byte if you wish) ReportNumber(int)

Johannes Rudolph
Yes, I do have a Year column. I can also use the Date to determine which quater it is. But still can not record the number after the dash sigh.
Roy
+1  A: 

How about:

Report: ID(int) Quarter(byte) Date(DateTime)

Mark Redman
...and even remove quarter?
Mark Redman
Thanks! I have the Data field, but how about the number after the dash sign? It is critical to the customer's business...
Roy
Not sure what you're asking. The data in the database wouldnt reflect dashes or any other report layout, its just the data store, you only need to format the report when its being generated? ...or am I missing something?
Mark Redman
I mean, user can just put a number there, not necessarily continous number. I would like to store the number also.
Roy
why didn't you add an int as I suggested.
Johannes Rudolph
A: 

The solution I'm going to use it to change the Quater to be a foreign key, point to another table, so I can easily deal with the database with LIVE DATA. or use 2 many to many table and record extra field there. What's your opinion? Thanks!

Roy

related questions