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 |
|
kidaduo
Starting Member
45 Posts |
Posted - 2008-04-08 : 14:50:40
|
| Help.How do u remove timestamp using select statement. Here is the list of records in my sql tableDatesent:1:2008-01-18 00:00:19.0002:2008-01-18 00:00:21.0003:2008-01-18 00:00:24.000I need to count these record and group them- If count and group them I will have three records for one count each for the date 2008-01-18. But I need to have one records with three count.here is my sql.SELECT datesent, COUNT(datesent) AS COUNT_RECORDSfrom MyTableJosephine |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2008-04-08 : 15:00:18
|
| SELECT datesent = convert(varchar(8),datesent,112), COUNT(*) AS COUNT_RECORDSfrom MyTablegroup by convert(varchar(8),datesent,112)you can also usedateadd(dd,0,datediff(dd,0,datesent))or many other methods==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
kidaduo
Starting Member
45 Posts |
Posted - 2008-04-08 : 15:10:08
|
Thank you NR. Exceleent!quote: Originally posted by nr SELECT datesent = convert(varchar(8),datesent,112), COUNT(*) AS COUNT_RECORDSfrom MyTablegroup by convert(varchar(8),datesent,112)you can also usedateadd(dd,0,datediff(dd,0,datesent))or many other methods==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy.
Josephine |
 |
|
|
|
|
|
|
|