[FIXED] Small issue with dates in reporting

Today I have sold some items, and closed the work perido, the I wanted to print my usual day by day report…

If you look at the dates, today is the 14th, and I am asking for the whole month report,
Its missing TODAY…
look at the dates and todays date, and I asked for the month:fevereiro interval

It should include today, I think…

Is this correct?

Thanks!!!

G

My guess is that it would depend on the criteria you are using in the SQL portion. Post your SQL.

1 Like

I dont think that this is an SQL issue.

I am selecting JANUARY:

as soon as I select JANUARY samba shows me 30 days in january, even thoe we worked on 31:

I I mannually put 31 in the combo on the upper right text boxes:

and click REFRESH, it goes again to 30 january…

I have to mannualy type 01 02 2016

in order to get the 31st day of january…

STRANGE behaviour… look at the upper left combo with dates, on the first screens you will see that january has 30 days… and then in the last screen you will see that january has 31 days…

What am I doing wrong?

Thanks!!!

G.

Hmm… It weird I get that as well. It look like in report query use start of the work period on both start and end range. The end range should be end of work period. When I select This Month, it report Feb 1, 2016 11:12 to Feb 14, 2016 16:29 (Start of work period).

Have you updated, this might be related to the fate issue I mentioned where if ends was after midnight and distinguishing.
If you set first of Feb did it also include 1st figures?

Yes, my work period end Feb 15, at 00:10. But query “This Month” should cover anything until Feb, 28.

I have to manually type end range to Feb 16 to get work period up to Feb 15 00:10. I look to me “This Month” use last work period start date/time.

This occurs when your Workperiod End date/time runs over midnight and into the next day. That is why you need to choose Feb 1 in order to get Jan 31.

It has always been this way, and it has always drove me a little bit crazy.

But @JTRTech may be correct - he did request a tweak for this that might be in the latest update.

Sorry for the late response…
I dont think this is the case…

That sunday (31 st january) we closed 22:30

must be something else…
Thanks!!!

G.

What version are you running?

I think its latest…
.58… but I dont know if it is exactly lastest refresh…

thanks!!!

G.

latest version should be 13/2/2016

Exactly the same behaviour, except that now I have an unregistered copy of samba…

strange!!!

thanks!!!

G.

Show your Report Template and SQL code please, so that we can try to accurately reproduce this.

Show your Report Template and SQL code please.

code template:

[Ventas Dia a Dia:3,3, 2, 2, 2, 2]
>Fecha|Dia|Neto|Taxa|Desc|Total
@@VentasDiarias
>TOTAL||@@TotalVentasDiarias

SELECT 
  convert(nvarchar,T.Date,103) as Fecha,  
  min(datename(dw,Date)) as Dia,
  FORMAT(ISNULL(SUM(T.TotalAmount)-SUM(Cal.CalculationAmount),0),'C') as NetoTicket,
  FORMAT(SUM(case 
      when Cal.CalculationTypeId = 3 then Cal.CalculationAmount
	  else 0 end),'C') as Taxa,
  FORMAT(SUM(case 
      when Cal.CalculationTypeId = 1 then Cal.CalculationAmount 
	  else 0 end),'C') as Desconto,
  FORMAT(SUM(T.TotalAmount),'C') as TotalTicket

FROM Tickets AS T

LEFT OUTER JOIN Calculations as Cal on Cal.TicketId = T.Id

WHERE Date >= '{Start}' AND Date <= '{End}'

GROUP BY convert(nvarchar,T.Date,103)

ORDER BY min(T.Date)


SELECT 
  FORMAT(ISNULL(SUM(T.TotalAmount)-SUM(Cal.CalculationAmount),0),'C') as NetoTicket,
  FORMAT(SUM(case 
      when Cal.CalculationTypeId = 3 then Cal.CalculationAmount
	  else 0 end),'C') as Taxa,
  FORMAT(SUM(case 
      when Cal.CalculationTypeId = 1 then Cal.CalculationAmount 
	  else 0 end),'C') as Desconto,
  FORMAT(SUM(T.TotalAmount),'C') as TotalTicket

FROM Tickets AS T

LEFT OUTER JOIN Calculations as Cal on Cal.TicketId = T.Id

WHERE Date >= '{Start}' AND Date <= '{End}'
1 Like

Hmm… interesting. This is definitely an issue. Here is proof of concept:

Report

[Date Start End Test:1,1,1,1]
>Start|End|StartFormatted|EndFormatted
@@DateTest

SQL:

declare @DTBEG varchar(30) = '{Start}'
declare @DTEND varchar(30) = '{End}'
declare @DTBEGF datetime
declare @DTENDF datetime

SET @DTBEGF = left(convert(varchar(30),@DTBEG,126),10) + 'T00:00:00'
SET @DTENDF = left(convert(varchar(30),@DTEND,126),10) + 'T23:59:59'

SELECT @DTBEG, @DTEND, @DTBEGF, @DTENDF

I selected “Past Month”…

So @emre, the Date Filter is clearly subtracting a day from {End} for what appears to be no good reason.

3 Likes

I reproduced it. Thank you. I’ll try to refresh update tomorrow.

2 Likes

Great, Thanks!!! to all for beleiving in me!!! jajajajajajajajajajjajajajajajajaja

serioulsy, Thanks!!!

G.

1 Like

I re-uploaded 5.1.58. Hope that works well.

3 Likes

Looks good @emre - all fixed.

3 Likes