473,324 Members | 2,473 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Time/amount

30
Hi all,
I searched but not exactly sure what I am looking for but here it is basically:
I have a couple of tables,
Employee:
[EmployeeID] [Fname][MI] [LName]....

Call History:
[EmployeeID] [Phone Number] [StartTime] [EndTime] (time stamp format)[QuantitySold]

What I would like to do is create an sql for each employee id in employee, linked to Call history in such a way that would allow me to graph Quantity sold per hour.

QTY
10
9
8
7........................................... |
6........................................... |
5........................................... |
4..................|.........................|
3 .................|.........................|
2........|.........|.........................|
1 .......|.........|..........| .............|
0____|_ ___|_____|_______|________
Hr 7 8 9 10 11 12 1 2 3 4 5
So Employee 1 sold say 3 items between hours 7 and 8, 5 items between hours 9 and 10, 2 items between hours 11 and 12, and 8 items between hours2 and 3
I am using MySQL and Excel. I would like to use bar graphs but to do this I need to show even zero values between 8/ 9, 10/11. 12/1, 1/2, 3/4, 4/5
Does this make sense?
Any ideas, any way to clarify this any better?

Thanks
Jas
Feb 7 '08 #1
1 994
MMcCarthy
14,534 Expert Mod 8TB
I think this will give you what you want, in this case I don't think you will need the other Employee table:

Expand|Select|Wrap|Line Numbers
  1. SELECT EmployeeID, DATE_FORMAT(EndTime, '%d %m %y') As DateSold, DATE_FORMAT(EndTime, '%h') As HourSold, Sum(QuantitySold)
  2. FROM Call History
  3. GROUP BY EmployeeID, DATE_FORMAT(EndTime, '%d %m %y'), DATE_FORMAT(EndTime, '%h')
  4. ORDER BY DATE_FORMAT(EndTime, '%d %m %y'), DATE_FORMAT(EndTime, '%h')
  5.  
Feb 11 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Bart Nessux | last post by:
am I doing this wrong: print (time.time() / 60) / 60 #time.time has been running for many hours if time.time() was (21600/60) then that would equal 360/60 which would be 6, but I'm not getting...
1
by: Pif Paf | last post by:
I have a process, and my process wants to wait for input but only for a certain amount of time. The input might be coming from a Python file object (created with popen) or a TCP socket. What I...
1
by: Simon Wadsworth | last post by:
My application uses VB6 WebClasses to handle the UI, so all requests come in via a stub ASP page. I would like to know the time taken for the request to be processed. I am trying to use the...
77
by: Charles Law | last post by:
Hi guys I have a time critical process, running on a worker thread. By "time critical", I mean that certain parts of the process must be completed in a specific time frame. The time when the...
12
by: wxs | last post by:
Many times we have a bunch of enums we have from either different enums or the same enum that will have various numeric values assigned. Rarely will there be collisions in numbering between the...
27
by: VK | last post by:
Following the side thread about the time precision in browser at <http://groups.google.com/group/comp.lang.javascript/browse_frm/thread/91b9f3fd90513161/1ea06131c63cfdf0?hl=en#doc_620f160f0cb57c8c>...
5
by: raybakk | last post by:
Hi there. If I make a function in c (I acually use gnu right now), is there any way to find out how many clocksycluses that function takes? If I divide some numbers etc Var1 = Var2/Var3, is it...
8
by: Jay | last post by:
I'm writing a game script and the point system will be based upon time. The less time there is between event one and event two, the higher score you'll get for event two. However, I've got a...
9
by: shuisheng | last post by:
Dear All, I have little experience in coding. For a c++ code with 30,000 lines, It is large or small? For two average programmers, usually how long does it take to finish the code? The code...
33
by: desktop | last post by:
In the C++ standard sec 23.1.2 table 69 it says that erase(q) where q is a pointer to an element can be done in amortized constant time. I guess that is not worst case since std::set is...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.