SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Subtracting one return from another
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Catflea
Starting Member

1 Posts

Posted - 06/07/2012 :  11:54:23  Show Profile  Reply with Quote
I have a search form which returns all the results from the database based on the search criteria...
It returns the "amount" and "amount paid"

As the amount paid gets higher I need the fifth line to subtract one from the other so we can see at a glance what the final figure owed is

Table below
<tr>
<td width='225' valign='top'>£{$row['amount']}<br /><br /></td>
<td width='112' valign='top'></td>
<td width='225' valign='top'>£{$row['amount_paid']}<br /><br /></td>
<td width='112' valign='top'></td>
<td width='225' valign='top'>£{$row['$amount SUBTRACT $amount_paid']}<br /><br /></td>
</tr>

The SQL request is within the search PHP script... can I do this simply with in this line of code?

webfred
Flowing Fount of Yak Knowledge

Germany
8514 Posts

Posted - 06/07/2012 :  14:01:58  Show Profile  Visit webfred's Homepage  Reply with Quote
will this work?

quote:
Originally posted by Catflea

I have a search form which returns all the results from the database based on the search criteria...
It returns the "amount" and "amount paid"

As the amount paid gets higher I need the fifth line to subtract one from the other so we can see at a glance what the final figure owed is

Table below
<tr>
<td width='225' valign='top'>£{$row['amount']}<br /><br /></td>
<td width='112' valign='top'></td>
<td width='225' valign='top'>£{$row['amount_paid']}<br /><br /></td>
<td width='112' valign='top'></td>
<td width='225' valign='top'>£{$row['$amount'] - $row['amount_paid']}<br /><br /></td>
</tr>

The SQL request is within the search PHP script... can I do this simply with in this line of code?


edit: otherwise post your sql statement please


No, you're never too old to Yak'n'Roll if you're too young to die.

Edited by - webfred on 06/07/2012 14:03:00
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000