Without knowing all of the details, it sounds like you have a one-to-many
relationship between document and user.  Here's what a basic table structure
might look like:

User Table
----------
UserId (PK)
Name
etc.

Document Table
--------------
DocumentId (PK)
Name
ApprovalStatus
etc.

DocumentApproval Table
----------------------
UserId (PK)
DocumentId (PK)
ApprovalStatus (Nullable)
etc.

For each person that has to approve a document, a record will exist in the
DocumentApproval Table.  The ApprovalStatus in that table will be populated
when that person approves or disapproves the document.  When a given
document doesn't have any records in the DocumentApproval Table with a NULL
in the Approval Status field, that means that it's ready to be approved or
disapproved by the administrator.

If the administrator either approves or disapproves the document, the
ApprovalStatus is updated in the Document table.

If you need a rule that says that a document must be approved (as opposed to
disapproved) by all users before going to the administrator, then you can
include a check of ApprovalStatus (in the DocumentApproval Table) in
addition to the NULL check mentioned above.

I think that covers everything that you described.  It can certainly get a
lot more complicated than that, but if your requirements are truly as simple
as you describe that should do the trick.

Let me know if you have any questions about the above,
Bob

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of David Nesbitt
> Sent: Monday, 4 February 2002 2:47 p.m.
> To: [EMAIL PROTECTED]
> Subject: [CFTALKTor] Q: Approval Process
>
>
> I'm working on an approval process where I have any number of
> Users approving a
> document. They either approve or disapprove a document. When all
> the uses have
> approved it gets sent to an admin for approval/disapproval.
> I'm having a bit of trouble coming up with a good database
> structure to handle
> this. I was wondering what other developers might have done table
> and query wise
> to solve this problem.
>
> I keep trying to make it overly complex. (I sometimes wish I had
> never learned
> nested queries).
>
>
> : David Nesbitt
> : Web Developer (ColdFusion)
> : Ottawa, ON Canada
> : [EMAIL PROTECTED]
>
>
> -
> You are subscribed to the CFUGToronto CFTALK ListSRV.
> This message has been posted by: "David Nesbitt" <[EMAIL PROTECTED]>
> To Unsubscribe, Please Visit and Login to http://www.CFUGToronto.org/
> Manager: Kevin Towes ([EMAIL PROTECTED])
> http://www.CFUGToronto.org/
> This System has been donated by Infopreneur, Inc.
> (http://www.infopreneur.net)
>



-
You are subscribed to the CFUGToronto CFTALK ListSRV.
This message has been posted by: "Bob Silverberg" <[EMAIL PROTECTED]>
To Unsubscribe, Please Visit and Login to http://www.CFUGToronto.org/
Manager: Kevin Towes ([EMAIL PROTECTED]) http://www.CFUGToronto.org/
This System has been donated by Infopreneur, Inc.
(http://www.infopreneur.net)

Reply via email to