calculation within query using combo

JaredNJames

Registered User.
Local time
Today, 23:11
Joined
Jul 7, 2007
Messages
87
hi, i have a query which retrieves data on products.

my problem is how to display a specific total i need.

there are three fields;
[itemprice],[itemlabour],[itemdiscount]

the item price and labour columns are in currency format, but the discount column allows the user to select a discount between 0 and 50%.

now in a form, when i want to calculate the total price to be paid i have a simple code like this:
[itemtotal] = ([itemprice]+[itemlabour])/[itemdiscount].column(1)
the idea being, when a discount is selected, there is a hidden column in the combo which contains a specific number to divide the total of [itemprice]+[itemlabour], thus giving a total.

now i tried to use this code within a query, but it doesnt work.

any ideas?

jared james
 
I don't think you can use that in a query Jared. That's not SQL language. But, what you can do, is get to the form control's column by calling a routine that references it. That's one workaround that you might try. You also might try just putting that value into another control so you can reference it by using SQL.
 

Users who are viewing this thread

Back
Top Bottom