Group by Date field

Results 1 to 2 of 2

Thread: Group by Date field

  1. #1
    Join Date
    Dec 1969

    Default Group by Date field

    Hi, I have an SQL statement that I need to group by a datetime field, but the datetime field includes the date together with time information, but I only want to group by the date... Anyway to go about doing it? Thanks in advance..

  2. #2
    Join Date
    Dec 1969

    Default What database?

    The answer *completely* depends on what DB you are using.<BR><BR>Access:<BR><BR>GROUP BY DateValue( yourDateTimeField )<BR><BR>SQL Server:<BR><BR>GROUP BY CONVERT( VARCHAR, yourDateTimeField, 112 )<BR><BR>The 112 is magic. See here:<BR><BR>(102 would also work)<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts