Query: Create column that is equal to two other columns multiplica

F

Fred

hi.. i would like to know how i can create a last column in the query i have
whose values have to be equal to the multiplication of another two columns..
So this column i want, won't get the values from a table, like every other
column, but use the others..

The code i have before creating that column is:
SELECT Table1.Ano, Table1.Parque, Table1.[Potência Produzida],
Table1.[Irradiância média], Table1.Temperatura, Table1.[Nº de horas de sol],
Table1.Mes, Table1.Tarifa, NumMes.ID
FROM Table1 INNER JOIN NumMes ON Table1.Mes = NumMes.mes
WHERE (((Table1.Ano)=[Forms]![Form3].[combo6]) AND
((Table1.Parque)=[Forms]![Form3].[combo4]));

The Column i want to create is called "Fact" and must be the multiplication
between the "Potencia produzida" field and "tarifa" field..

Can you help me please..
Many thanks Nuno
 
J

John W. Vinson

The Column i want to create is called "Fact" and must be the multiplication
between the "Potencia produzida" field and "tarifa" field..

Simply type the expression in a vacant Field cell in the query grid; you can
assign a fieldname by putting it before the expression with a colon:

Fact: [Potencia produzida] * [tarifa]

If either value is NULL you will get a NULL result; you can use the NZ()
function to replace NULL by Zero or by any other appropriate value.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top