a.entrydate>=datum - 1
? Since datum
is a date, you're going to end up with a float for that result, e.g. select now()-1
comes back as 20140303090955.0000
.
perhaps you want
... where ... and a.entrydate >= (datum - INTERVAL 1 DAY)
instead.