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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. UNCMoochie

    Question an update using case or an if statement

    thanks amrita, so the case statement doesn't act as an elseif correct? the second it comes across a clause that matches, it ends?
  2. UNCMoochie

    Question an update using case or an if statement

    Thanks for that, i corrected myself above. it was a mistake a made while posting. sorry about that i have to remember to double check before posting... I still have the issue described above though. any help would be greatly appreciated.
  3. UNCMoochie

    Question an update using case or an if statement

    when i execute this code, i get id s98 s99 s00 yr_joined ============================================ 1 206 65 11 2000 2 0 23 11 2000 3 0 0 11 2000 4 99 23 11 2000 5 614 0 11 2000 for the result set... when it should be (or i should say I want it to be) id s98 s99...
  4. UNCMoochie

    Question an update using case or an if statement

    ignore the 'Green' i typed that accidentally same thi g with the line below... what i actually had was: Create Table #T1 (Id Int, s98 Int,s99 Int, s00 Int, yr_joined varchar(4)) Insert Into #T1 Values(1, 206,65,11,'') Insert Into #T1 Values(2, 0,23,11,'') Insert Into #T1 Values(3, 0,0,11,'')...
  5. UNCMoochie

    Question an update using case or an if statement

    I'm trying to rebuild and reorganize a database table. This table i'm working off of has a column for every year going back to 1973 and the total number of goods purchased by a customer in each column (it's very unorganized). There isn't a customer file and I'm trying to create one with a...
  6. UNCMoochie

    Percent of total Table value

    gotcha, my apologies.
  7. UNCMoochie

    Need help with a query using multiple conditions

    I didn't think of that at all. That definitely simplifies things. Thanks Denis. The data currently isn't in 1s and 0s it's actually in letters, but i'm going to convert it for this and change it back afterwards. Out of curiosity, is there some other way this could work without summing and...
  8. UNCMoochie

    Percent of total Table value

    just a suggestions, you may have to cast/convert the count as a float if you want the percentage. I've had some problems converting counts to percentages with that in the past. cast(count(inv_skids) as float)/(select cast(count(inv_skids)) as float) from table1)
  9. UNCMoochie

    Need help with a query using multiple conditions

    Thanks for the quick reply Dennis. The columns i'm referring to are columns that represent different flags in a record, so 0 or 1 will work (even though i was jsut using it as an example). With the query you wrote above, it would also return records where (lets say i am looking for cases where...
  10. UNCMoochie

    Need help with a query using multiple conditions

    I am trying to create a query where 50% or more of the options in my where clause are true. For example lets say i have 4 cols for a record that relate to some kind of code. call them Col1, Col2, col3, col4. Instead of writing out all the different permutations of ways 75% or more of the...

Part and Inventory Search

Back
Top