all groups > sql server misc > february 2004 >
You're in the

sql server misc

group:

database design question


database design question facetoface72 NO[at]SPAM hotmail.com
2/25/2004 6:25:13 AM
sql server misc:
Hi,

I have a database which currently has a 'Clients' table which contains
the NT User Id, Full Name, and Department of each user in the company.
It gets imported at the end of each month, but this is where the
problem comes in.

Let's say I have a table that reports phone calls by each user, and we
want to charge that department for the lenght of the call. My Phone
calls table would do a join on the clients table (where names match),
but what happens if the user quit half way through the month, that
user wont be in the Clients table since they were removed. This
creates an issue since that department now wont be charged for the
first half of the month for that user. Also, this creates an issue
with history of phone calls from several months ago. Again, the phone
calls table will have each call placed, but the user may no longer be
in the clients table.

I've thought about this, and can't figure out how to make sure the
monthly data has every user, even if they are only there for half a
month. Should I keep a table of ALL users ever employed? Any ideas??

Re: database design question Jeremy Collins
2/25/2004 2:28:04 PM
[quoted text, click to view]


[quoted text, click to view]

The simplest thing to do is not the delete the emmployee
record, but simply store the date when they leave.

--
jc

Re: database design question James Goodman
2/25/2004 3:43:27 PM
Yup, & possibly have a bit field which marks an account as active/inactive.
That way you can always account for all users...

--
James Goodman
MCSE MCDBA
http://www.angelfire.com/sports/f1pictures/
[quoted text, click to view]

Re: database design question Jeremy Collins
2/25/2004 3:50:18 PM
[quoted text, click to view]

Yes, if there is a distinction between "inactive" and "gone",
otherwise a NULL leaving date has the same effect as Active = 1.

--
jc

AddThis Social Bookmark Button