Coding Thread, SQL graph fun in Coding and Web Development; I am trying to pull out data from our till system as follows:
Number of sales between 12pm and 2pm, ...
1st December 2010, 10:51 AM #1
SQL graph fun
I am trying to pull out data from our till system as follows:
Number of sales between 12pm and 2pm, grouped by the day they happened.
I then want to use this to display on a graph in Microsoft Reporting Services, so the results need to be in pairs - the number, and the date in question.
Now, my question is, how do I do this grouping? I can do the 'between' part I think
But the grouping is being a little more elusive, as there will be more than one Day '1' and I don't want these stuck together too.
WHERE DATEPART(hh,DateColumn) BETWEEN 12 AND 14
IDG Tech News
1st December 2010, 10:57 AM #2
Ok, answering this myself, I can do it using the DATEPART(dy, DateColumn) instead, and then limit it down to a specific date range (eg. year)
1st December 2010, 11:01 AM #3
So Day 1 is Monday? Why not group by the date, a singular figure, and just include the attached day (if needed)
1st December 2010, 11:02 AM #4
1st December 2010, 11:04 AM #5
The problem I have is the system uses DateTime columns, rather than Date columns, so I have to work around that.
1st December 2010, 11:37 AM #6
I understand, yes I think you are on right lines
By tinmanjo in forum Office Software
Last Post: 1st July 2010, 01:31 PM
By cgiuk in forum Office Software
Last Post: 19th May 2010, 09:58 AM
By FN-GM in forum EduGeek.net Site Problems
Last Post: 9th April 2010, 10:33 AM
By CyberNerd in forum *nix
Last Post: 5th November 2008, 02:25 PM
By imiddleton25 in forum Office Software
Last Post: 10th September 2008, 04:25 PM
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)