Suming different types in a query

  • Thread starter Thread starter Mark909
  • Start date Start date
M

Mark909

I have a number of different cables in a Column called "Type"

I also have a Column "Length" with length in meters.

How do I query out the total length of two different types of cable

I can do a query so i get:

Red: 40
Gold: 60

but what i really want is the query to just give me 100

I could do this in a report but what i want it for the query to display the
100

Thanks for any help
 
Mark909 said:
I have a number of different cables in a Column called "Type"

I also have a Column "Length" with length in meters.

How do I query out the total length of two different types of cable

I can do a query so i get:

Red: 40
Gold: 60

but what i really want is the query to just give me 100

I could do this in a report but what i want it for the query to display
the
100

Thanks for any help

SELECT Sum([Length]) FROM YourTable WHERE [Type] = 'Red' OR [Type] = 'Gold'
 
Back
Top