Question:

How do I use the "IF" ,"OR" ,"ELSE" function in Excel & SQL Server??

by  |  earlier

0 LIKES UnLike

I want to automate my table to specify the class of the items within.

For example;When I enter the word "Coffee",it should auto-fill type as "misc" Likewise,if I enter the word "Cigarettes" it should do the same. How can I do this b'se it looks like there's a specific limitation of 1:1 . Please Help,Only genuine help sought... Thanks

**Please,if possible, provide the syntax for both programs. Thank you.

 Tags:

   Report

1 ANSWERS


  1. In Excel, I would probably do this thru a lookup table. If you had a table in cells A1:B100 with the 100 commodities in column A and the corresponding category in column B; a subsequent column X with a commodity could fill in the category in Y via the following function for column Y:

    =VLOOKUP(A1,B100,Xn,TRUE)

    (see http://office.microsoft.com/en-us/excel/...

    For SQL Server, I'd just make a table essentially the same as the Excel lookup table - for any other table that uses the commodity, the category is easily retrieved.

    table commodities (commodity_code, commodity_label, commodity_category, ...)

    table inventory (commodity_code, on_hand, ...)

    select (c.commodity_label, commodity_category, on_hand, ...)

    from commodities c, inventory i

    where c.commodity_code = i.commodity_code

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.
Unanswered Questions