Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query, adding multiple columns to get new column in view or query 1

Status
Not open for further replies.

akalinowski

IS-IT--Management
Oct 3, 2006
190
US
OK< i know that probably sounds ridiculous, here is what i need to figure out:

table a:

Style, QTY1, QTY2, QTY3
TSHIRT, 1, 3, 4

i want a query that gives me this result from that table:
STYLE, QTY(TOTAL)
TSHIRT, 8

this possible?

akalinowski
MCSE 2000, A+, N+, LCP, CNE
 
I have to ask this first: is there any way you can alter the design of this database? What do the different quantity fields represent? Sizes? What happens if a new size is introduced?

OK, rant over.

The simple answer to your question is

SELECT style, QTY1+QTY2+QTY3 total
FROM Mytable

Phil Hegedusich
Senior Programmer/Analyst
IIMAK
-----------
Not NULL-terminated yet.
 
i'm taking data out of an existing DB that i have read only ODBC access to and importing into a SQL db that i then create historical reports from.
the different qty fields represent "Size Buckets" there are 18 size buckets and depending on the size code each bucket represents a different size (XXS, XS, S, M, L, XL or 1, 2, 3, 4... so on and so forth)

i care about total OH qty by style nad need to combine them like above.

thanks for your help

akalinowski
MCSE 2000, A+, N+, LCP, CNE
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top