0

Hi

I want to figure out a way to update multiple rows that depend on a couple of variables. I don't really know the syntax in SQL, but I know what I would do in C, so maybe if you could translate this...

switch (x)
     case 0:
           switch(y)
             case 0: myVar = var;
             case 1: myVar = someOtherVar;
     case 1:

.
.
.

Something like that is what I need to do. I could do it all with a bunch of queries but I don't really want to do it that way.

Edited by TGeorge824: n/a

3
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by BitBlt
0

Hi

I want to figure out a way to update multiple rows that depend on a couple of variables. I don't really know the syntax in SQL, but I know what I would do in C, so maybe if you could translate this...

switch (x)
     case 0:
           switch(y)
             case 0: myVar = var;
             case 1: myVar = someOtherVar;
     case 1:

.
.
.

Something like that is what I need to do. I could do it all with a bunch of queries but I don't really want to do it that way.

In Access it would be something like

Select Case x
    Case 0
        Select Case y
          Case 0
             MyVar = var
          Case 1
             MyVar = SomeOtherVar
        End Select

    Case 1
         Select Case y
             Case 0
                MyVar = OneMoreVar
             Case 1
                MyVar = GotVar
         End Select

    Case Else
          Msgbox "This has not been configured."
   
End Select
0

Was gonna post some clever SQL, then suddenly remembered this wasn't the SQL Server forum <blush>.

Edited by BitBlt: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.