473,385 Members | 1,356 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,385 software developers and data experts.

sum orders for each hour in hours

hi
i'm stack in query problem i need sql query that can sum(orders columns)for each hour in day

the result is like this

date/time | order | doors | center

11/02/2008 08:12:20 | 1 | 1 | ----
11/02/2008 08:12:22 | 3 | 2 | ----
11/02/2008 08:12:23 | 1 | 2 | ----

i want it like this

date/time | order | doors | center

11/02/2008 09:00 | 1 | 1 | ----
11/02/2008 09:00 | 4 | 2 | ----
Dec 15 '08 #1
4 1183
Frinavale
9,735 Expert Mod 8TB
You can use the SQL SUM() Function to calculate the sum of a column.

Use a WHERE clause to specify which times should be added together.


Please attempt to create your SQL query. Use something like Query Analyzer to test your SQL query...If you are still having problems with it, please post what you have tried so far. Please remember to use code tags when posting code snippets.


-Frinny
Dec 15 '08 #2
balabaster
797 Expert 512MB
Is this a SQL question or an ASP.NET question? Do you need to do this in an application or on the SQL Server itself?

If you're doing it in the SQL Server, this question should be moved to the SQL Server forum...
Dec 16 '08 #3
r035198x
13,262 8TB
I'd have moved it if I knew for sure which database they are using.
Dec 17 '08 #4
Frinavale
9,735 Expert Mod 8TB
@r035198x
I was waiting for the OP to reply with more details :)
Dec 17 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Anne | last post by:
Hi I have got a table with some sales transactions. It has got 3 fields 1) Ordernumber 2) Item number 3) Shippingdate Now I want to make ONE (not two) query that shows how many different...
3
by: Jamie Pittman via AccessMonster.com | last post by:
I am currently working on a project to take an employees time for a day and and if over 8 hours it would move those extra hours to overtime row amd not caculate into regular time. I started to use...
4
by: Stephen Young | last post by:
Hello Have a bit of a problem, im trying to get the total number of hours:minutes for all actions over the month in a query, have tried two methods to no luck... Duration This Month:...
5
by: marty | last post by:
As part of an assignment I need to calculate a 24 hour time by subtracting a one time from another e.g. if the user enters 1.00 as the time and 1.30 as the time to subtract the returned time is...
112
by: Tom | last post by:
This is very strange: I have a Windows Form with a Panel on it. In that panel I dynamically (at run time) create some labels, as so: for i=1 to x dim ctlNew as New Label() with ctlNew...
3
by: syargus | last post by:
I have a database that was built for us by a gentlemen from Sri Lanka. The database was supposed to have an invoice that could be edited after it was created and also there was supposed to be a...
0
by: Flyzone | last post by:
Hi all, i'm again working on my script of parsing logfiles :) I putted a new function to disable the rule of error between a certain hours, cause i want to use it as a monitoring script that run...
1
by: George | last post by:
Hello........I have a problem adding up record entries with more than 24 hours when the fields are formatted as hour/minute (h:m). If the actual summed total of all records is greater than 24...
8
by: Jomba | last post by:
Hi everyone, In folder image i have 24 pictures, and i would like to have some javascript that will every hour put another picture as background image. I would like to do that on this page...
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
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.