As I understand, we sum the column car_count, and group the fields!
I tried your query, and I want to say Thank You! It works, and gives the desired result.
If it is not too much trouble, would you suggest me any REALLY good SQL Server Programming Books?
Have a nice day!
Hi all,
I have a question: How to Sum values of two columns (car_count) using Select Query?
**Direction: A road has two lanes, direction 1, and direction 2. I want the output to be only one row per hour, with the sum of car_count values showing up.
For Example:--
hour station_id speed_class...
I got the answer, here it is:
SELECT cast(((DatePart(Hour,date_hour)-1) % 12)+1 as varchar(2)) + CASE when DatePart(Hour,date_hour)<12 then 'AM' else 'PM' end
out put is: 8AM
Cheers!
I got the answer, here it is:
SELECT cast(((DatePart(Hour,date_hour)-1) % 12)+1 as varchar(2)) + CASE when DatePart(Hour,date_hour)<12 then 'AM' else 'PM' end from sum where date_hour >='2003-04-04 08:00:00.000' and date_hour <= '2003-04-04 20:00:00.00' and sensorid= '5001' and direction =...
Hi all,
I have a datetime field called date_hour. Currently the values that are being stored in this field are in this format: 2003-04-04 08:00:00.000. What should I write in my Select statement so that the query returns that value: 8 AM
Please Help!
Thanks in advance.
Hi Techies,
My Computer is connected to a domain called "cs". I want only those users that are physically registered into my computer should be able to login (locally), NOT by selecting the cs domain from the combo-box at Login window. How do I get rid of this cs domain selection from...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.