Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query not working

Status
Not open for further replies.

stevehatpa

Technical User
Feb 2, 2006
9
0
0
US
I'm somewhat of a novice with SQL 2000, so please bear with me.

I have created a large query in SQL Query Designer. Unfortunately I cannot use CASE statements in this. Essentially I need to all values in column TX_PA_HOMESTEAD.HOMESTEAD_12, that are less than 51 to become 50, and all other values to stay what they are. The statement below is what I tried and it did not work.

WHEN TX_PA_HOMESTEAD.HOMESTEAD_12<51 THEN 50 ELSE TX_PA_HOMESTEAD.HOMESTEAD_12

Does anyone have ideas as to what I can put in query designer to get the results I need?

Thanks!

Steve H.
 
If you have questions related to Microsoft SQL Server, then you should post your question here: forum183

Unfortunately, the SQL Query Designer will sometimes place arbitrary restrictions on your query. As such, I encourage you to use Query Analyzer instead.

In Enterprise Manager, click Tools > SQL Query Analyzer. Make sure the correct database is selected, then write (or copy/paste) or query. Your query should look something like...

Code:
Select col1,
       col2,
       Case WHEN TX_PA_HOMESTEAD.HOMESTEAD_12<51 
            THEN 50 
            ELSE TX_PA_HOMESTEAD.HOMESTEAD_12
            END As HOMESTEAD_12_Modified
From   Table
etc...



-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top