469,081 Members | 1,804 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,081 developers. It's quick & easy.

Urgent help - Problem with multiple select ROUND statments

attached is my full query that I am currently working on:
Declare @counterday1 int
Declare @counterday2 int

set @counterday1 = '20'
set @counterday2 = '629'

Declare @CounterMin07_01 float
Declare @CounterMin08_01 float
Declare @CounterMin09_01 float
Declare @CounterMin10_01 float
Declare @CounterMin11_01 float
Declare @CounterMin12_01 float
Declare @CounterMin13_01 float
Declare @CounterMin14_01 float
Declare @CounterMin15_01 float
Declare @CounterMin16_01 float
Declare @CounterMin17_01 float
Declare @CounterMin18_01 float

Declare @CounterMin07_02 float
Declare @CounterMin08_02 float
Declare @CounterMin09_02 float
Declare @CounterMin10_02 float
Declare @CounterMin11_02 float
Declare @CounterMin12_02 float
Declare @CounterMin13_02 float
Declare @CounterMin14_02 float
Declare @CounterMin15_02 float
Declare @CounterMin16_02 float
Declare @CounterMin17_02 float
Declare @CounterMin18_02 float

Declare @CounterMax07_01 float
Declare @CounterMax08_01 float
Declare @CounterMax09_01 float
Declare @CounterMax10_01 float
Declare @CounterMax11_01 float
Declare @CounterMax12_01 float
Declare @CounterMax13_01 float
Declare @CounterMax14_01 float
Declare @CounterMax15_01 float
Declare @CounterMax16_01 float
Declare @CounterMax17_01 float
Declare @CounterMax18_01 float

Declare @CounterMax07_02 float
Declare @CounterMax08_02 float
Declare @CounterMax09_02 float
Declare @CounterMax10_02 float
Declare @CounterMax11_02 float
Declare @CounterMax12_02 float
Declare @CounterMax13_02 float
Declare @CounterMax14_02 float
Declare @CounterMax15_02 float
Declare @CounterMax16_02 float
Declare @CounterMax17_02 float
Declare @CounterMax18_02 float

Declare @CounterAvg07_01 float
Declare @CounterAvg08_01 float
Declare @CounterAvg09_01 float
Declare @CounterAvg10_01 float
Declare @CounterAvg11_01 float
Declare @CounterAvg12_01 float
Declare @CounterAvg13_01 float
Declare @CounterAvg14_01 float
Declare @CounterAvg15_01 float
Declare @CounterAvg16_01 float
Declare @CounterAvg17_01 float
Declare @CounterAvg18_01 float

Declare @CounterAvg07_02 float
Declare @CounterAvg08_02 float
Declare @CounterAvg09_02 float
Declare @CounterAvg10_02 float
Declare @CounterAvg11_02 float
Declare @CounterAvg12_02 float
Declare @CounterAvg13_02 float
Declare @CounterAvg14_02 float
Declare @CounterAvg15_02 float
Declare @CounterAvg16_02 float
Declare @CounterAvg17_02 float
Declare @CounterAvg18_02 float

Select @CounterMin07_01 = ROUND(Min(CounterValue),2)
From counterdata
where counterid = @counterday1 and counterdatetime BETWEEN '2003-10-30
07:00:00' AND '2003-10-30 07:59:59'

Select @CounterMin08_01 = ROUND(Min(CounterValue),2)
From counterdata
where counterid = @counterday1 and counterdatetime BETWEEN '2003-10-30
08:00:00' AND '2003-10-30 08:59:59'

Select @CounterMin09_01 = Min(CounterValue)
From counterdata
where counterid = @counterday1 and counterdatetime BETWEEN '2003-10-30
09:00:00' AND '2003-10-30 09:59:59'

Select @CounterMin10_01 = Min(CounterValue)
From counterdata
where counterid = @counterday1 and counterdatetime BETWEEN '2003-10-30
10:00:00' AND '2003-10-30 10:59:59'

Select @CounterMin11_01 = Min(CounterValue)
From counterdata
where counterid = @counterday1 and counterdatetime BETWEEN '2003-10-30
11:00:00' AND '2003-10-30 11:59:59'

Select @CounterMin12_01 = Min(CounterValue)
From counterdata
where counterid = @counterday1 and counterdatetime BETWEEN '2003-10-30
12:00:00' AND '2003-10-30 12:59:59'

Select @CounterMin13_01 = Min(CounterValue)
From counterdata
where counterid = @counterday1 and counterdatetime BETWEEN '2003-10-30
13:00:00' AND '2003-10-30 13:59:59'

Select @CounterMin14_01 = Min(CounterValue)
From counterdata
where counterid = @counterday1 and counterdatetime BETWEEN '2003-10-30
14:00:00' AND '2003-10-30 14:59:59'

Select @CounterMin15_01 = Min(CounterValue)
From counterdata
where counterid = @counterday1 and counterdatetime BETWEEN '2003-10-30
15:00:00' AND '2003-10-30 15:59:59'

Select @CounterMin16_01 = Min(CounterValue)
From counterdata
where counterid = @counterday1 and counterdatetime BETWEEN '2003-10-30
16:00:00' AND '2003-10-30 16:59:59'

Select @CounterMin17_01 = Min(CounterValue)
From counterdata
where counterid = @counterday1 and counterdatetime BETWEEN '2003-10-30
17:00:00' AND '2003-10-30 17:59:59'

Select @CounterMin18_01 = Min(CounterValue)
From counterdata
where counterid = @counterday1 and counterdatetime BETWEEN '2003-10-30
18:00:00' AND '2003-10-30 18:59:59'

Select Min07_01 = @CounterMin07_01,
Min08_01 = @CounterMin08_01,
Min09_01 = @CounterMin09_01,
Min10_01 = @CounterMin10_01,
Min11_01 = @CounterMin11_01,
Min12_01 = @CounterMin12_01,
Min13_01 = @CounterMin13_01,
Min14_01 = @CounterMin14_01,
Min15_01 = @CounterMin15_01,
Min16_01 = @CounterMin16_01,
Min17_01 = @CounterMin17_01,
Min18_01 = @CounterMin18_01

For some reason the @CounterMin07_01 does report a value of 0.00 but
the @CounterMin08_01 reports something like 7.9823623372E-11 instead
of 0.00

Any Ideas???
Jul 20 '05 #1
0 2359

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

14 posts views Thread by bolidev | last post: by
8 posts views Thread by Tim::.. | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.