Ohhh. It all makes sense. I am going to brake everything in little pieces.
(@due =[d] today or @today) except (@done///* or (@recurring >=[d] today and @recurring <=[d] tomorrow))
I believe that we already understand the first part. Since the recurring part of your equation was after the “except”, you were actually hiding things that you wanted to see. But before we place that in the right place, lets fix that part of the statement.
If I understand correctly, you only want to get things that.
A) Are recurring.
B) The recurring tag is due today.
@recurring >=[d] today and @recurring <[d] tomorrow
That will do it. I eliminated the equal part after the tomorrow since you only wanted things due today. Going back the the first part of the search you understood,
(@due =[d] today or @today) except @done///*
Now just add the last statement in the section where you are describing things you want to find.
((@due =[d] today or @today) or (@recurring >=[d] today and @recurring <[d] tomorrow)) except @done///*
Technically, I believe you could eliminate a parenthesis, but I tend to build complex queries by dividing them into little chunks that I put together. I like to keep the parenthesis so that I can later understand my logic. No kidding, I have found papers I wrote 7-10 years ago that I marvel I actually wrote since I have almost no recollection of them.
In case you wanted to know what I was talking about eliminating a parenthesis, here it is,
@due =[d] today or @today or (@recurring >=[d] today and @recurring <[d] tomorrow) except @done///*
Just don’t eliminate the parenthesis on the recurring part or you will have something completely different.