In my db table i have a field (called dtAdded) that contains date/time values. An example of a value in the field dtAdded would be; 01/19/2001 12:35:58. Notice that it keeps trak of month/day/year hour:min:second. My question is, how can I use the SQL Group By to group records by the month/day/year using the dtAdded field. In other words, I can't run
SELECT * FROM TABLE GROUP BY dtAdded, because the GROUP BY will group only the dtAdded values that are the exact same down to the second. I want to group records that are restricted only by a specific day ie. month/day/year.
You may ask, "Why not get rid of the time in dtAdded?". Well, I want the end user to choose how he wants to group records together - by day, month, year, hour, minute or second.
SELECT * FROM TABLE GROUP BY dtAdded, because the GROUP BY will group only the dtAdded values that are the exact same down to the second. I want to group records that are restricted only by a specific day ie. month/day/year.
You may ask, "Why not get rid of the time in dtAdded?". Well, I want the end user to choose how he wants to group records together - by day, month, year, hour, minute or second.