there scenario is here :

-Client will have contract with the company (who belongs this system).

-Client have a START_DATE & END_DATE for the project (period)

-The contract period will be count in monthly NOT year; example a contract period is 2 years=counted as 24 months.

-Client have two method to pay the contract; Whether MONTHLY or QUARTERLY

System will:

** Calculate the contract period in month.A month equal with 30 days.

- Once the admin insert the percentage of payment paid by client, system will display the percentage and amount left.

-For MONTHLY payment method the formula is (CONTRACT_PERIOD/CONTRACT_AMOUNT)

Which will show how much the client should pay per-month

-For QUARTERLY payment method the formula is [(CONTRACT_PERIOD/CONTRACT_AMOUNT)*3] which will show how much the client should pay per-quarterly

=================================================================================

***the main problem now is HOW TO WRITE THE CODE & FORMULA to make the system calculate the days /years in period to month?(convert) like example : "contract of client XYZ started from 1 Jan. 2008 and end on 12 march. 2009" which is equal to 406 days (forgive me if i'm wrong)or 13.5 months.

(Admin will insert the start_date & end_date= I use Date Time Picker in VB.Net.)

***How to make the system calculate the remain balance of unpaid payment : example XYZ have a contract which costed $500k and already paid 20% (the percentage will be insert by Admin; ouh.. this is another problem, when admin will put the percentage OR exact amount already paid=example XYZ already paid $50k, how many percent left?)>> System should automatically shows the amount in $

**should i write the formula/arithmetic inside the VB code or should i write in the SQL query or BOTH? and how is the formula and syntax should i use? please help me.. and if possible could anyone write a little program/codes in here...

for ur information i already finished the design of all forms and database's table (but without data and any formula)..so i just need to know what arithmetic and code should use and where is the line in VB and SQL.

sorry coz i wrote to much things in here but i have to explain it deeply so everyone will understand my problems/questions

=================================================================================

This post has been edited by **yukirou**: 05 April 2010 - 07:05 PM