Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using BETWEEN
Message
 
To
11/10/2012 15:18:27
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Environment versions
SQL Server:
SQL Server 2008
Miscellaneous
Thread ID:
01554816
Message ID:
01554845
Views:
32
Hi Dorris, (Dorris, Boris, very confusing!)

Are you sure you do not have any nulls in either AdjLow or AdjHigh?

Hugo

>Boris
>
>AdjLow and AdjHigh are numeric(6,4) fields in the table
>
>
>Both of you
>
>The full SQL is
>
>Update TestResult set ECLScore = (Select ECLScore from ScoreTable where @TotEAP between AdjLow and AdjHigh) where SCN = @SCN
>
>
>>>>Hi again, All
>>>>
>>>>I've got an SP that has the following
>>>>
>>>>
>>>>@TotEAP numeric(6,4)
>>>>@EAP numeric(7,5)
>>>>
>>>>**ListenEAP is already in my table from earlier update
>>>>
>>>>Select @TotEAP = (@EAP + ListenEAP)/2 from TestResult where SCN = @SCN  &&This works as expected
>>>>
>>>>Update TestResult set ECLScore = (Select ECLScore from ScoreTable where @TotEAP between AdjLow and AdjHigh)
>>>>
>>>>
>>>>AdjLow and AdjHigh are numeric(6,4).
>>>>
>>>>Here's the problem:
>>>>
>>>>The update doesn't happen with @TotEAP defined as a 6,4 (or even a 6,3) but it DOES work if @TotEAP is defined as a 6,2
>>>>
>>>>Nothing I'm reading in the help file is giving me any indication as to why it's not? Ideas?
>>>>
>>>>Thanks
>>>
>>>It depends how AdjLow and AdjHigh defined.
>>
>>The UPDATE looks a bit strange - do you want to update all rows in the table with the same constant value?
>>
>>E.g. what does select ECLScore from ScoreTable where @TotEAP between AdjLow and AdjHigh
>>
>>return?
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform