Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Multiplication in dreamweaver

New Here ,
Mar 05, 2011 Mar 05, 2011

Hey Guys - please help me.

I have these columns:

product_code

buying_price

markup

make

When I visit a product detail page, I am passing the product_code variable and the following query produces a selling price (ie buying_price x markup%)

SELECT ROUND(SUM(buying_price*(1+ (markup/100))),2)
FROM products
WHERE product_code = colname

All is well.

Imagine from my homepage I choose to view all products from a manufacturer on a results page. (ie I pass a 'make' variable)

What query can I run to ensure the 'selling price' is shown against each product?

At the momment all I can acheive is showing the complete selling cost of all products within that manufacturer.

Hope this makes sense - much appreciated if you would look into this for me.

Thanks

TOPICS
Server side applications
516
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Mar 05, 2011 Mar 05, 2011
LATEST

The following sample query demonstrates how to calculate one field (item_price) by applying the calculation to a Column Alias (AS item_price_sum):

SELECT item_code, item_description, item_price, SUM(item_price*1.5) AS item_price_sum FROM calculations GROUP BY item_code ORDER BY item_price ASC

Once an alias column is defined, Dreamweaver´s Bindings Panel will be displaying this "virtual field" alongside the real ones (e.g. item_code).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines