Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
usafelix
Posting Yak Master
165 Posts |
Posted - 2014-09-01 : 10:15:58
|
Anyone can review this query have any problem ?I desire output by each hour of sales by different shop total with sales_datetime format is 20140831 22:30:xxx. for example now is 23:05 then desire result is 23:00-23:05 of sale.-----------------------------------------------------------------select shopid,qty,amount from sales where sales_datetime>='hh:mm' and sales_datetime<='hh:mm' group by shop |
|
gbritton
Master Smack Fu Yak Hacker
2780 Posts |
Posted - 2014-09-01 : 11:03:44
|
don't you need to SUM the sales? |
|
|
usafelix
Posting Yak Master
165 Posts |
Posted - 2014-09-01 : 13:07:51
|
my desire of each hour of sales by different shop total sales amount,qty and sales_datetime format is 20140831 22:30:xxx |
|
|
gbritton
Master Smack Fu Yak Hacker
2780 Posts |
Posted - 2014-09-01 : 13:51:19
|
ok -- so lets see your query that does the totals! |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
|
|
|
|