• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 214
  • Last Modified:

CASE not working right with expression

in my select statement, I am trying to set a value with a CASE, and its saying it doesn't like my expression '>='

It says Incorrect Syntax.

CASE INCREMENT_RANGE WHEN >= '0' THEN '1' END AS TIME_VALUE
0
chrisryhal
Asked:
chrisryhal
  • 2
  • 2
1 Solution
 
BrandonGalderisiCommented:
If you're doing anything other than = in a case, it all has to go in the WHEN, not between case and when.

ex.

CASE WHEN INCREMENT_RANGE >= '0' THEN '1' END AS TIME_VALUE
0
 
BrandonGalderisiCommented:
Also, you don't want quotes around integer values, unless you have them stored in a varchar field.
0
 
PedroCGDCommented:
You need to add WHEN:
CASE WHEN INCREMENT_RANGE WHEN >= '0' THEN '1' END AS TIME_VALUE

Check and give feedback!
0
 
PedroCGDCommented:
You need to add WHEN:
CASE WHEN INCREMENT_RANGE >= '0' THEN '1' END AS TIME_VALUE

Check and give feedback!
0
 
chrisryhalAuthor Commented:
Thanks!!
0

Featured Post

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now