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 |
|
zsdave
Starting Member
4 Posts |
Posted - 2009-08-10 : 14:42:33
|
| I am trying to create a report for some attorneys that will sort their court appearances by the date of the trial and then by the county. Even though I try to format the date field to not include the time its as if its still there. So whats currently happening is it sorts by the day, but it breaks up the county by the time the actual trial is in the datetime field. MondayCounty A - 8:30County A - 9:00County B - 10:00County A - 10:30What I would like is something like this...MondayCounty A - 8:30County A - 9:00County A - 10:30County B - 10:00Any help would be greatly appreciated |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2009-08-10 : 15:21:15
|
| assuming your trial date column is a DATETIME datatype here is one way:order by dateadd(day, datediff(day, 0, <TrialDateCol>), 0), [County]Be One with the OptimizerTG |
 |
|
|
zsdave
Starting Member
4 Posts |
Posted - 2009-08-10 : 15:34:53
|
| That got it, thank you very much TG! |
 |
|
|
|
|
|