Solved

CASE not working right with expression

Posted on 2008-10-29
5
182 Views
Last Modified: 2012-05-05
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
Comment
Question by:chrisryhal
  • 2
  • 2
5 Comments
 
LVL 39

Accepted Solution

by:
BrandonGalderisi earned 500 total points
ID: 22832912
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
 
LVL 39

Expert Comment

by:BrandonGalderisi
ID: 22832919
Also, you don't want quotes around integer values, unless you have them stored in a varchar field.
0
 
LVL 22

Expert Comment

by:PedroCGD
ID: 22832944
You need to add WHEN:
CASE WHEN INCREMENT_RANGE WHEN >= '0' THEN '1' END AS TIME_VALUE

Check and give feedback!
0
 
LVL 22

Expert Comment

by:PedroCGD
ID: 22832949
You need to add WHEN:
CASE WHEN INCREMENT_RANGE >= '0' THEN '1' END AS TIME_VALUE

Check and give feedback!
0
 
LVL 2

Author Closing Comment

by:chrisryhal
ID: 31511260
Thanks!!
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently, when I was asked to create a new SQL 2005 cluster, Microsoft released a new service pack for MS SQL 2005 what is Service Pack 3. When I finished the installation of MS SQL 2005 I found myself troubled why the installation of SP3 failed …
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question