Jump to content

Query needed with gathering data for a report?


Solarpitch

Recommended Posts

Hey Guys,

 

I have a table in my database that stores a list of transactions that take place on a POS system. I need to generate a report which will tell the client how much they made for each hour of the day:

 

6am - 7am -> €450.00

7am - 8am -> €687.00 and son on...

 

This is a cut down example of my database and how the date and time format is stored...

 

DATE               ITEM            PRICE          TIME
20071006         budwiser       4.60            06:31:01
20071006         coke             2.30           06:31:01
20071006         guinness       4.30            06:42:05
20071006         cider            4.60            07:02:16
20071006         crisps           0.70            07:02:16

 

I'm not quite sure what to do with the query. I know how to get the sum of a column and all but its a little confusing when I need to loop through the results and calculate the total for each hour.  :-\

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.