473,372 Members | 1,000 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,372 software developers and data experts.

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 2512

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: bolidev | last post by:
I'm new to SQL and can't figure out how to update my table (StoreItemStatus) that contains the current status for items in each store (STORE_KEY, ITEM_KEY, STATUS,...). I get updated status info...
2
by: Dimitri | last post by:
PLEASE HELP,I HAVE A DATABSE WITH MULTIPLE RECORDS AS OUTLINED BELOW EMP NO LEVEL NEXTINCREASE WAGETYPE UNIT 1000 1 0 1000 1000 1 0 1002 ...
0
by: TLi | last post by:
Hi I'm having problems in enumerating checked items of checkedlistbox. I'm trying to do following string sVal foreach(myObject _myobj in checkedListBox1.CheckedItems sVal = _myobj.value...
4
by: John | last post by:
Hi all, This really is quite an urgent matter. I have a page with multiple, dynamically-loaded user controls and when a user clicks on a button, the whole form is submitted. Now at this stage...
8
by: Tim::.. | last post by:
Can someone please tell me why I keep getting the following error for some of my web application users but not others??? Even though the application runs from a central webserver??? Thanks for...
1
by: sneha123 | last post by:
There will be some 20 questions and for each question there will be 4 choices.what i want to do is to select multiple answers by clicking the checkbox. i m using asp.net,vb.net pls help me we...
2
by: Zeya | last post by:
I have an application where I am required to run a full text query. My database is MySQL and code in C#. The way all queries are SELECT * FROM table WHERE firstname = ? and using command...
1
by: lord_yomon | last post by:
My DLL object has Multiple Execution Method for SQL Statments, all you have to do is to feed it with 5 SQL Statments and it will only save if all run perfectly, otherwise it will rollback. The DLL...
10
by: 60325 | last post by:
This is the page where I collect the data in drop-down boxes with values of 1-10 and send it to a submitted page to do calculations. Example: Employee1 TeamScore(1-10) Employee2 ...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.