 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Stijn Verrept Guest
|
Posted: Sun Aug 24, 2003 8:19 pm Post subject: Some design questions |
|
|
I need to create a program for elderly homes, that has a table with people
in it, and another table with codes.
Some codes happen dayly, some weekly and others monthly. The codes can be
assigned to the people. For example: one code will be for a days stay.
People can check out (for a few days, for example due to hospital transfer)
and back in. At the end of the month I need an overview of all the days
that someone stayed, and of course the other codes.
The program will be a multi-user C/S program.
1) What would be ideal design for something like this?
2) Do I record every day??? (this will create a lot of data and I would
like to keep the databse below 2 GB)
3) Do I only record the entry and exit days? (this will be a lot less data
but it will be more difficult to calculate totals)
4) Where do I do the transfer of one day to the next one? At the end of a
day some of the codes will need to get saved to the people that have them
assigned, this has to be done automatically so I guess it's a bad idea to do
this at client level??? Should I use jobs with stored procedures for this?
Ok that's about it, any input is greatly appreciated. Also if you could
think of some other stuff that could be interested please let me know.
Thanks in advance,
Stijn Verrept.
|
|
| Back to top |
|
 |
Stijn Verrept Guest
|
Posted: Mon Aug 25, 2003 12:28 pm Post subject: Re: Some design questions |
|
|
Thanks for the reply,
yes but then I will have to do the calculations, because in one month people
can check out and in several times .
"Dell Stinnett" <my.name (AT) zcsterling (DOT) com> wrote
| Quote: | In the table that relates codes to people, you could put two additional
fields - Start_Date and End_Date. Then you would have all the data you
need
in one record to determine the length of time each code applied to the
person.
|
|
|
| Back to top |
|
 |
Eric Hill Guest
|
Posted: Mon Aug 25, 2003 2:52 pm Post subject: Re: Some design questions |
|
|
| Quote: | Durations then become an aggregate query:
|
And you want a duration based on "now" for those people still "in". Use
NVL or the equivilent in your database to convert all null values in
STOP_TIME to the current system date and time. That way your queries will
always represent "current" data, i.e. if a person has been "in" for 3 days,
today you get 3 days, tomorrow you get 4 days.
| Quote: | SELECT
FIRST_NAME,
LAST_NAME,
CODE_DESCR,
SUM(NVL(STOP_TIME, SYSDATE)-START_TIME) AS TOTAL_TIME
FROM
PEOPLE
NATURAL JOIN CODES
NATURAL JOIN EVENTS
GROUP BY
FIRST_NAME,
LAST_NAME,
CODE_DESCR
|
Eric
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|