Solved

CASE not working right with expression

Posted on 2008-10-29
5
199 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL Merige returns error code when updating 15 60
Following an example - removing duplicate strings 4 70
Query 14 62
Help Required 2 58
This article will describe one method to parse a delimited string into a table of data.   Why would I do that you ask?  Let's say that you need to pass multiple parameters into a stored procedure to search for.  For our sake, we'll say that we wa…
Data architecture is an important aspect in Software as a Service (SaaS) delivery model. This article is a study on the database of a single-tenant application that could be extended to support multiple tenants. The application is web-based develope…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

751 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