If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Grouping by a date and user

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-27-04, 11:07
pudge717 pudge717 is offline
Registered User
 
Join Date: Apr 2004
Posts: 1
Grouping by a date and user

I have to produce a report in ASP that shows all the employees names across the top and a date range down the side. I need to populate this grid with the SUM(nCount) for each employee on each day. I am getting it to grab the count for each employee but it will not populate 0's in place of the reps that donot have records for that day.
also if there are more than 1 employee with a record for that day, it will duplicate the date on the left.
basically what is am looking for is sql to grab and group the data correctly and then asp to populate a grid.
can anyone help?

table
tbl_items
__________
rep_name
nCount
date
Reply With Quote
  #2 (permalink)  
Old 05-27-04, 13:27
guelphdad guelphdad is offline
Registered User
 
Join Date: Mar 2004
Posts: 440
Can you show a few sample rows of data? Probably you can use CASE to get what you want without using ASP.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On