Click here to Skip to main content
15,895,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
How can I calculate with a calculated field ?

For example
In Item table there are column
1.Item name
2.Item rate
3.Item quantity
4. Payment amount
I want a query were I need to show the following data
1.Item name
2. Item rate
3.Item quantity
4.Total amount (by item rate*item quantity)
5. Payment amount
6. due(Total amount-Payment amount)

I easily create Total amount field but I could not create due field
Please help me to solve
Posted

1 solution

Try This

SQL
Select Itemname,Itemrate,Itemquantity,itemrate*itemquantity as Totalamount,Paymentamount,(itemrate*itemquantity)-Paymentamount as due
from ItemTable
 
Share this answer
 
Comments
Espen Harlinn 29-Oct-11 8:01am    
5'ed :)
P.Salini 29-Oct-11 8:03am    
Thanks Harlinn
RaisKazi 29-Oct-11 12:51pm    
A 5!
P.Salini 31-Oct-11 0:51am    
Thanks Raiskazi

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900