So you tag the ticket based on ticket created time?
When I get to this would like to maybe try tagging on order level on hour basis as above as would be handy for their manager to better see peak times of the day and ensure sufficient staff on duty etc.
As the aim would see when the busy times are, as sometime tickets - especially might be open customer bar tabs might be open all day or over lunch & dinner.
Would I be right to say that with ticket tag the whole ticket value would go to the time that the ticket was opened?
Say if someone came in at 12 and started a tab with drinks, wife came in at 4 - they both had food and stayed for few more drinks till say 6 or 8, their bill could easily be over £100. If im right to say the value would be tagged as ticket start time this would be £100+ at 12noon.
Does that make sense?
The exemple that i posted here is not from sambapos. I saw it on a friend pos and I’m trying to make this report on custom reports.
Sql or tags report it does not matter.
Can you please help me out?
Ok that makes sense JTRTech. My method works but the issue with the report your looking for it would require a LOT of tags and doesnt seem realistic. It might be better to just build it with SQL. @emre has provided examples many times let me see if I can find one.
Please, is Joe
Its not important at this time, have more general work to do before looking too heavily at custom reports.
My samba development has had to go on back burner as have allot on at the minute. Was just a curiosity…
I need to step out until tomorrow, but I started some code - saving it here until later…
declare @Start datetime = '2015-01-10T00:00:00.000'
declare @End datetime = '2015-01-10T23:59:59.000'
declare @Hour int = 0
declare @tbl_Sales table
[ID] INT IDENTITY(1,1) NOT NULL
WHILE @Hour < 24
INSERT INTO @tbl_Sales
@Hour as [Hour]
, SUM(CASE WHEN (DATEPART(hour,[Date])>=@Hour AND DATEPART(hour,[Date])<@Hour+1)
ELSE 0 END) as [Amount]
WHERE [Date]>=@Start AND [Date]<=@End
SET @Hour = @Hour + 1
SELECT [Hour], [Amount] FROM @tbl_Sales