General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
>>anyone,
>>how do you write an SQL statement to be passed to sqlserver7 to group by date only without the time in datetime interfering in the process ?
>
>select < aggregate >, < aggregate > from MyTable group by Convert(Char(10),MyDatetimefield,101)
>
>You can use most any expression in the Group By clause with SQL Server and the field does not have to be in the field list (as it does in VFP).
>
>HTH.
That is if you're only returning aggregates in the select list. If you put any table field in the list you will need to put it on the group by too.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only