![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have a SQL table with the following fields: accounts, orderid's and datetime Account OrderID Datetime 1 1 2007-03-01 09:30 1 2 2007-03-01 09:35 10 3 2007-03-01 10:30 2 4 2007-03-01 11:30 10 5 2007-03-01 12:30 Using Query Analyzer, I'd like to run a query where the results are a count of orderId's by account on any given day like what I have below: Account Orders Date 1 2 2007-03-01 2 1 2007-03-01 10 2 2007-03-01 Eventually getting it to this output: Date TotalOrder 2007-03-01 5 Thanks for the help! |
#3
| |||
| |||
|
|
I have a SQL table with the following fields: accounts, orderid's and datetime Account OrderID Datetime 1 1 2007-03-01 09:30 1 2 2007-03-01 09:35 10 3 2007-03-01 10:30 2 4 2007-03-01 11:30 10 5 2007-03-01 12:30 Using Query Analyzer, I'd like to run a query where the results are a count of orderId's by account on any given day like what I have below: Account Orders Date 1 2 2007-03-01 2 1 2007-03-01 10 2 2007-03-01 |
|
Eventually getting it to this output: Date TotalOrder 2007-03-01 5 |
#4
| |||
| |||
|
#5
| |||
| |||
|
|
the other thing you need to consider is adding a constraint to be sure that the time is always set to 00:00:00 Hrs so that you do not have fix it on the fly in your queries. Mop the floor but also fix the leak. |
#6
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |