Help with yesterday sensor state

After hass update something changed, please help.
This was working before update:

select max(strftime('%Y%m%d %H:%M',created,'1 day')) as created, state FROM	states WHERE entity_id = 'sensor.spotreba_denni_celkem' and created between datetime('now','-1 DAY','-1 hour') and datetime('now','-1 DAY')	and domain = 'sensor';

Now its empty and in sql add on showing this:

### Results (1)

|created|state|
| --- | --- |
|NULL|NULL|

When i remove this

and created between datetime('now','-1 DAY','-1 hour') and datetime('now','-1 DAY')

It is showing data

This is working:

select max(strftime('%Y%m%d %H:%M',created,'1 day')) as created, state FROM	states WHERE entity_id = 'sensor.spotreba_denni_celkem' and created between datetime('now','-6 days','-1 hour') and datetime('now','-1 DAY')	and domain = 'sensor';

I changed only from -1 day to -6 days
oO