If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > SQL - Stored procedure

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-12-07, 16:08
tpoettker tpoettker is offline
Registered User
 
Join Date: May 2004
Posts: 13
SQL - Stored procedure

I am having difficulty with this stored procedure. I am hoping there are most experts than myself that can put this together. I seem to be drawing a blank.

The criterias are as follows:

when reserve_type_code = 369 then
paid_total = IndemnityPaid
collection_total = IndemnityCollected
reserve_amount = IndemnityReserve
incurred_amount = IndemnityIncurred

when reserve_type_code = 368 then
paid_total = ExpensesPaid
collection_total = ExpensesCollected
reserve_amount = ExpensesReserve
incurred_amount = ExpensesIncurred

NetIndemnity = IndemnityPaid - IndemnityCollected
If IndemnityReserve> NetIndemnity then GreaterIndemnity = IndemnityReserve
If IndemnityReserve< NetIndemnity then GreaterIndemnity = NetIndemnity

NetExpenese = ExpenesePaid - ExpensesCollected
If ExpensesReserve> NetExpenses then GreaterExpenses = ExpensesReserve
If ExpensesReserve< NetExpenses then GreaterExpenses = NetExpenses

If GreaterIndemnity + GreaterExpenses > 500,000, then I need the claim_id to return to my program


The table is one-to-many


Please help!!!
Thanks
Tina
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On