Jump to content

Trying To Add a % to a total in Dreamweaver Wont work.


swanside

Recommended Posts

Hello all,

I have a MySQL database and have made several search and results pages with Dreamweaver, but I am stuck with a problem. I have a table called materials, In this table I have the following fields, Title (A description of a location where the item is for), Job_No (A filed that is common through out the database and a material item is attached to the Job_No), Quantity (SPeaks for itself, but is the amount of items used), Unit_Price (A cost per item), Additional_Cost (Is the selling cost per item as a percentage i.e. 20% 10% and so on).

 

In Dreamweaver, I have created a recordset from the table required (material) and if I go to the advanced setting I cna enter the following,

 

SELECT Quantity * Unit_Price

FROM `material`

WHERE Job_No = 'colname'

 

This then gives me the total of the materials used against a selected Job_No and displays it into a dynamic Table. The problem comes when I want to automatically add the percentage from the Additional_Cost.

If I go into the database using MyPHPAdmin and enter,

SELECT Quantity*Unit_Price+(Quantity*Unit_Price*Additional_Cost/100) FROM `material` WHERE Job_No = 1000980, it works, and I get the main total, but, if I put this code into dreamweaver,

 

SELECT Quantity*Unit_Price+(Quantity*Unit_Price*Additional_Cost/100)

FROM `material`

WHERE Job_No = 'colname'

 

 

Or

 

SELECT Quantity*Unit_Price+(Additional_Cost%)

FROM `material`

WHERE Job_No = 'colname'

it wont work. My space in the Dynamic Table is blank?

 

Can anybody please help?

 

Cheers

Paul.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.