I have a table of deks
As you can see, I try to know if the user have a booking for today or tomorrow.
I used a rollup that can return me the latest booking so if a user book just for today (and have the previous booking) that’s fine. But if a user book for tomorrow, I’m screwed.
Any idea of how I could have a boolean for is_seated_today and is_seated_tomorrow?
Bonus question: if I can get them today and tomorrow booking details (like with a relation) it would be even better.
Another way would be able to filter a relation column for (or test it for the presence of) a particular date.
Booking relation would be filtered or tested with
Have you been able to solve this?
Can you try this:
The “Today” and “Tomorrow” columns will be changed, so the boolean If > Then > Else columns will be changed as well.
It can’t work. Because then the relation will be only on the date, and gonna match the first booking for today no matter if it’s the current user or not.
- At least it missing being able to put multiple conditions on a relation.
- Or being able to select a relation column to make a relation
- Or being able to do a CONTAIN condition on a IF THEN ELSE on Booking
Just to confirm, what you want to return is whether in the bookings users have made, is there one that match today, and one that match tomorrow. Is that correct?
if in all the bookings made by the users (likely one every day) there’s one with the date = TODAY and one with the date = TOMORROW
What I mean for the relation was to match the today column to the “Booking” relation you have returned. Can you try that?