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 |
|
jamie
Aged Yak Warrior
542 Posts |
Posted - 2008-04-29 : 09:16:23
|
| hi,I have a person table with a field createdate and personid,how can I display how many customers existed in the table by date.eg.1/4 2002/4 2503/4 2564/4 280regards,amie |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-04-29 : 09:20:37
|
If CreateDate is either SMALLDATETIME or DATETIME, try thisSELECT DATEADD(DAY, DATEDIFF(DAY, '19000101', CreateDate), '19000101'),COUNT(DISTINCT PersonID)FROM Table1GROUP BY DATEADD(DAY, DATEDIFF(DAY, '19000101', CreateDate), '19000101') E 12°55'05.25"N 56°04'39.16" |
 |
|
|
jamie
Aged Yak Warrior
542 Posts |
Posted - 2008-04-29 : 09:24:30
|
| hi Peso,no that doesn't work,I this shows me customers that were created on each day.I would need to accumulate the values each day...? |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-04-29 : 09:33:51
|
Why didn't you tell us from the beginning?Mail m_k_s and he will help you soon. E 12°55'05.25"N 56°04'39.16" |
 |
|
|
jamie
Aged Yak Warrior
542 Posts |
Posted - 2008-04-29 : 10:23:04
|
| apologies for not being clear peso, will email now. |
 |
|
|
|
|
|
|
|