Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

CASE not working right with expression

Posted on 2008-10-29
5
Medium Priority
?
212 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 2000 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

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 …
I am showing a way to read/import the excel data in table using SQL server 2005... Suppose there is an Excel file "Book1" at location "C:\temp" with column "First Name" and "Last Name". Now to import this Excel data into the table, we will use…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

916 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