Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Group By With Timestamp

Status
Not open for further replies.

luvrexx

Programmer
Apr 12, 2006
7
US
Hi,

I am writing a query that requires a date which is a timestamp,i am using the date()fun to eliminate the hrs:sec etc part. Moreover I also need to use group by here which is creating the problem.Its showing duplicate rows because i have to use the timestamp to group by.Can anyone help,please.
 
so you are using the date as the parameter and then you are also grouping by that date?? the way i am interpreting it doesn't make sense...i guess i don't follow 100%
 
You need to convert the date to a varchar, give it an alias, and group on the alias. Get rid of the timestamp field. You will NEVER be able to get what you want because of that field. You can't sum it, so you have to group by and group by with timestamp never works.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top