Jul 10, 2001 #1 link9 Programmer Nov 28, 2000 3,387 US Can anyone help me out with some syntax on how to make a field in a returned dataset 1 if some condition is satisfied, or 0 if it's not??? ex) SELECT col1, col2, (IF col1 >= col2 THEN 1 ELSE 0) AS condition FROM table Is that possible??? thx - Paul Prewett
Can anyone help me out with some syntax on how to make a field in a returned dataset 1 if some condition is satisfied, or 0 if it's not??? ex) SELECT col1, col2, (IF col1 >= col2 THEN 1 ELSE 0) AS condition FROM table Is that possible??? thx - Paul Prewett
Jul 10, 2001 1 #2 Jerrycurl Programmer Aug 4, 1999 85 US Something like this: SELECT col1, col2, condition = CASE WHEN col1 >= col2 THEN 1 ELSE 0 END FROM table Upvote 0 Downvote
Something like this: SELECT col1, col2, condition = CASE WHEN col1 >= col2 THEN 1 ELSE 0 END FROM table
Jul 10, 2001 Thread starter #3 link9 Programmer Nov 28, 2000 3,387 US Boy, there are some stars flying today. Thanks, buddy. Upvote 0 Downvote