General discussion
Thread display: Collapse - |
All Comments
Start or search
Create a new discussion
If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.
Need T-SQL Help
vdrWorkComp (bit) is true or false as to whether we need a current Workman's Comp certificate from the vendor.
vdrWorkCompExp (datetime) - the date the Workman's Comp certificate expires, if we need one.
vdrLiabilityIns (bit) istrue of false as to whether we need a current Liability Insurance certificate from the vendor.
vdrLiabilityInsExp (datetime) - the date the Liability Insurance certificate expires, if we need one.
vdrPriceAgreement (bit) is true or false as to whether we need a current Price Agreement with the vendor.
vdrPriceAgreementExp (datetime) - the date the Price Agreement expires, if we need one
vdrActive (bit) is true or false depending... here's the logic:
If a Vendor needs any one of the three, then they must be current to be active. If it is a Vendor we don't need any one of even all of them from, then they are active. So, for example, Vendor Joe Bugsplatt might need Liability and a Price agreement, but not Workman's Comp, so he is Active if Liability Insurance and Price Agreement are current, and Workman's Comp is ignored. Some Vendors don't get any, but are still Active - like Government Permitting Agencies.
I want to write this in a scheduled task that will sweep the table every night to see if anyone's status changed. I tried writing it, but I got so many if...then statements wrapped around one another, I nearly choked myself! LOL!!!
Advice? Suggestions?
Thanks,
Bob