How to create an expression

J

Jenn Civello

I need to create an expression to total 2 columns. The 2 columns are
Qunatity 2 and Quantity 3, I would like the 3rd coulmn to be Total
Shipped:... Can you please lett me what I need to type in the expression
field.

Thanks
 
O

Ofer

Try this

Select [Qunatity 2], [Quantity 3], ([Qunatity 2]+[Quantity 3]) as
TotalShipped From TableName
 
J

Jenn Civello

I tried this and I get this following error: The specified field
'[Quantity2]' could refer to more than one table listed in the FROM clause of
your SQL statement. Do you know why I am getting this error?

Thanks

Ofer said:
Try this

Select [Qunatity 2], [Quantity 3], ([Qunatity 2]+[Quantity 3]) as
TotalShipped From TableName

--
I hope that helped
Good luck


Jenn Civello said:
I need to create an expression to total 2 columns. The 2 columns are
Qunatity 2 and Quantity 3, I would like the 3rd coulmn to be Total
Shipped:... Can you please lett me what I need to type in the expression
field.

Thanks
 
O

Ofer

You get this error message when you have to tables in the query that contain
the same field name, in that case you should add the table name to the field
name

Select [TableName].[Qunatity2], [TableName].[Quantity3],
([TableName].[Qunatity2]+[TableName].[Quantity3]) as
TotalShipped From TableName


--
I hope that helped
Good luck


Jenn Civello said:
I tried this and I get this following error: The specified field
'[Quantity2]' could refer to more than one table listed in the FROM clause of
your SQL statement. Do you know why I am getting this error?

Thanks

Ofer said:
Try this

Select [Qunatity 2], [Quantity 3], ([Qunatity 2]+[Quantity 3]) as
TotalShipped From TableName

--
I hope that helped
Good luck


Jenn Civello said:
I need to create an expression to total 2 columns. The 2 columns are
Qunatity 2 and Quantity 3, I would like the 3rd coulmn to be Total
Shipped:... Can you please lett me what I need to type in the expression
field.

Thanks
 
J

Jenn Civello

I have gotten the query to work with that expression, thanks. But now I am
trying to create another query based on 5 queries that I created with the
expression below and when I do I get the following error: You have chosen
fields from record sources which the wizard can't connect. You may have
chosen fields from a table and from a query based on that table. If so, try
choosing fields from only the table or only the query. Do you know why I am
getting this error?

Ofer said:
You get this error message when you have to tables in the query that contain
the same field name, in that case you should add the table name to the field
name

Select [TableName].[Qunatity2], [TableName].[Quantity3],
([TableName].[Qunatity2]+[TableName].[Quantity3]) as
TotalShipped From TableName


--
I hope that helped
Good luck


Jenn Civello said:
I tried this and I get this following error: The specified field
'[Quantity2]' could refer to more than one table listed in the FROM clause of
your SQL statement. Do you know why I am getting this error?

Thanks

Ofer said:
Try this

Select [Qunatity 2], [Quantity 3], ([Qunatity 2]+[Quantity 3]) as
TotalShipped From TableName

--
I hope that helped
Good luck


:

I need to create an expression to total 2 columns. The 2 columns are
Qunatity 2 and Quantity 3, I would like the 3rd coulmn to be Total
Shipped:... Can you please lett me what I need to type in the expression
field.

Thanks
 
O

Ofer

Does each query, by it self, work OK?
--
I hope that helped
Good luck


Jenn Civello said:
I have gotten the query to work with that expression, thanks. But now I am
trying to create another query based on 5 queries that I created with the
expression below and when I do I get the following error: You have chosen
fields from record sources which the wizard can't connect. You may have
chosen fields from a table and from a query based on that table. If so, try
choosing fields from only the table or only the query. Do you know why I am
getting this error?

Ofer said:
You get this error message when you have to tables in the query that contain
the same field name, in that case you should add the table name to the field
name

Select [TableName].[Qunatity2], [TableName].[Quantity3],
([TableName].[Qunatity2]+[TableName].[Quantity3]) as
TotalShipped From TableName


--
I hope that helped
Good luck


Jenn Civello said:
I tried this and I get this following error: The specified field
'[Quantity2]' could refer to more than one table listed in the FROM clause of
your SQL statement. Do you know why I am getting this error?

Thanks

:

Try this

Select [Qunatity 2], [Quantity 3], ([Qunatity 2]+[Quantity 3]) as
TotalShipped From TableName

--
I hope that helped
Good luck


:

I need to create an expression to total 2 columns. The 2 columns are
Qunatity 2 and Quantity 3, I would like the 3rd coulmn to be Total
Shipped:... Can you please lett me what I need to type in the expression
field.

Thanks
 
J

Jenn Civello

Yes, but I need to add them together now into a Report or Query.

Ofer said:
Does each query, by it self, work OK?
--
I hope that helped
Good luck


Jenn Civello said:
I have gotten the query to work with that expression, thanks. But now I am
trying to create another query based on 5 queries that I created with the
expression below and when I do I get the following error: You have chosen
fields from record sources which the wizard can't connect. You may have
chosen fields from a table and from a query based on that table. If so, try
choosing fields from only the table or only the query. Do you know why I am
getting this error?

Ofer said:
You get this error message when you have to tables in the query that contain
the same field name, in that case you should add the table name to the field
name

Select [TableName].[Qunatity2], [TableName].[Quantity3],
([TableName].[Qunatity2]+[TableName].[Quantity3]) as
TotalShipped From TableName


--
I hope that helped
Good luck


:

I tried this and I get this following error: The specified field
'[Quantity2]' could refer to more than one table listed in the FROM clause of
your SQL statement. Do you know why I am getting this error?

Thanks

:

Try this

Select [Qunatity 2], [Quantity 3], ([Qunatity 2]+[Quantity 3]) as
TotalShipped From TableName

--
I hope that helped
Good luck


:

I need to create an expression to total 2 columns. The 2 columns are
Qunatity 2 and Quantity 3, I would like the 3rd coulmn to be Total
Shipped:... Can you please lett me what I need to type in the expression
field.

Thanks
 
O

Ofer

Add them one by one, and run, until you get an error, that way you can know
which one cause the problem
--
I hope that helped
Good luck


Jenn Civello said:
Yes, but I need to add them together now into a Report or Query.

Ofer said:
Does each query, by it self, work OK?
--
I hope that helped
Good luck


Jenn Civello said:
I have gotten the query to work with that expression, thanks. But now I am
trying to create another query based on 5 queries that I created with the
expression below and when I do I get the following error: You have chosen
fields from record sources which the wizard can't connect. You may have
chosen fields from a table and from a query based on that table. If so, try
choosing fields from only the table or only the query. Do you know why I am
getting this error?

:

You get this error message when you have to tables in the query that contain
the same field name, in that case you should add the table name to the field
name

Select [TableName].[Qunatity2], [TableName].[Quantity3],
([TableName].[Qunatity2]+[TableName].[Quantity3]) as
TotalShipped From TableName


--
I hope that helped
Good luck


:

I tried this and I get this following error: The specified field
'[Quantity2]' could refer to more than one table listed in the FROM clause of
your SQL statement. Do you know why I am getting this error?

Thanks

:

Try this

Select [Qunatity 2], [Quantity 3], ([Qunatity 2]+[Quantity 3]) as
TotalShipped From TableName

--
I hope that helped
Good luck


:

I need to create an expression to total 2 columns. The 2 columns are
Qunatity 2 and Quantity 3, I would like the 3rd coulmn to be Total
Shipped:... Can you please lett me what I need to type in the expression
field.

Thanks
 
J

Jenn Civello

I have done that, and I know which field is causing the problem, but how do I
correct this?

Ofer said:
Add them one by one, and run, until you get an error, that way you can know
which one cause the problem
--
I hope that helped
Good luck


Jenn Civello said:
Yes, but I need to add them together now into a Report or Query.

Ofer said:
Does each query, by it self, work OK?
--
I hope that helped
Good luck


:

I have gotten the query to work with that expression, thanks. But now I am
trying to create another query based on 5 queries that I created with the
expression below and when I do I get the following error: You have chosen
fields from record sources which the wizard can't connect. You may have
chosen fields from a table and from a query based on that table. If so, try
choosing fields from only the table or only the query. Do you know why I am
getting this error?

:

You get this error message when you have to tables in the query that contain
the same field name, in that case you should add the table name to the field
name

Select [TableName].[Qunatity2], [TableName].[Quantity3],
([TableName].[Qunatity2]+[TableName].[Quantity3]) as
TotalShipped From TableName


--
I hope that helped
Good luck


:

I tried this and I get this following error: The specified field
'[Quantity2]' could refer to more than one table listed in the FROM clause of
your SQL statement. Do you know why I am getting this error?

Thanks

:

Try this

Select [Qunatity 2], [Quantity 3], ([Qunatity 2]+[Quantity 3]) as
TotalShipped From TableName

--
I hope that helped
Good luck


:

I need to create an expression to total 2 columns. The 2 columns are
Qunatity 2 and Quantity 3, I would like the 3rd coulmn to be Total
Shipped:... Can you please lett me what I need to type in the expression
field.

Thanks
 
Top