[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

[sqr-users] Need Help with Evaluation



Hi,

I used to be on this group, but somehow stopped receiving mail... that was
okay because I stopped using SQR....until now...


Anway, I have a tricky SQR to write (at least, it seems tricky).   I have a
record, cmt_id, in Commitments (cmts) which has many statuses in the
Statuses table.   What I want to do is find the "highest" or "most
important" status and insert that current status in the cmts table.

So, I need to get all the statuses for the rec cmt_id and then compare them.
It's not that easy, because even if they both have the status Pending, then
we want to take the one with the most recent date.   Same goes if it is
Delayed or Ongoing, because they are on the same level of importance, so
we'd want the latest one.

I'm thinking of an evaluation statement, but I'm not even sure how to start
it.

I've selected all the statuses for the particular cmt_id like this:

begin-procedure get_cmt
select cmt_id &cmt_id
  do get_stat
from pmc_commitments
end-procedure

begin-procedure get_stat
select status &status
from pmc_statuses
where cmt_id = &cmt_id


Okay, that returns the cmt_id and all it's statuses.... now how do I go
about comparing the different statuses so that I can pull the "most
important" one (based on the criteria I have).

Thanks a ton in advance!!!


jenny

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users