CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeCharge.Discussion

 Calculating product cost based on bands

Print topic Send  topic

Author Message
Joost De Raeymaeker
Posted: 06/25/2001, 1:21 AM

Hi there,

I'm trying to calculate cost of a product (located in table 1), based on price bands (joined by product_id, located in table 2). So basically, a product has various
prices that change with product quantity.
I would like to give the users the opportunity to specify a number (of product quantity) and calculate the cost based upon the price-bands. Can anyone give me
a hand with this one?
I was thinking of putting a field not linked to any database on a form with the product name and this field and then passing it along as a parameter to another
form on the same page, and the calculating the cost based upon the price bands (I have fields for minimum and maximum quantity for the price bands, so I can
create a custom SQL select that does a <= and a >=). I'm using PHP an MySQL.

Joost
PS: Any hints highly appreciated.
Tony Tomov
Posted: 06/25/2001, 1:51 AM

Go to Community Discussion menu in Code Charge site
and serch the topic "Calculating virtuals on the fly" from Tony Tomov
I'm not sure that this is right for you, but this is a idea.
Regards
Tony Tomov

Joost De Raeymaeker wrote:

> Hi there,
>
> I'm trying to calculate cost of a product (located in table 1), based on price bands (joined by product_id, located in table 2). So basically, a product has various
> prices that change with product quantity.
> I would like to give the users the opportunity to specify a number (of product quantity) and calculate the cost based upon the price-bands. Can anyone give me
> a hand with this one?
> I was thinking of putting a field not linked to any database on a form with the product name and this field and then passing it along as a parameter to another
> form on the same page, and the calculating the cost based upon the price bands (I have fields for minimum and maximum quantity for the price bands, so I can
> create a custom SQL select that does a <= and a >=). I'm using PHP an MySQL.
>
> Joost
> PS: Any hints highly appreciated.
Dr. Scott R. Senay
Posted: 06/25/2001, 3:05 PM

Greetings Joost!

What I might suggest is to have an after update event that does a dlookup();
on the quantity entered. This way you simply pass dlookup the arguments for
the data requested with the quantity in there and have it pass back a result
which becomes your answer...

Quick, clean and simple... Optionally you can have it as an after insert
event that only fires when you submit, it iterates through the fields doing
a dlookup on each and returns an array or results...

Scott...

Joost De Raeymaeker <joost@deraeymaeker.com> wrote in message
news:1103_993457564@sam...
> Hi there,
>
> I'm trying to calculate cost of a product (located in table 1), based on
price bands (joined by product_id, located in table 2). So basically, a
product has various
> prices that change with product quantity.
> I would like to give the users the opportunity to specify a number (of
product quantity) and calculate the cost based upon the price-bands. Can
anyone give me
> a hand with this one?
> I was thinking of putting a field not linked to any database on a form
with the product name and this field and then passing it along as a
parameter to another
> form on the same page, and the calculating the cost based upon the price
bands (I have fields for minimum and maximum quantity for the price bands,
so I can
> create a custom SQL select that does a <= and a >=). I'm using PHP an
MySQL.
>
> Joost
> PS: Any hints highly appreciated.
>


   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.