Heello. I have to make method which changes bool dynamicly and overtime and it should depends on two date variables.
3 Tables: Customers, movies, transactions.
When making a transaction(rent movie) between two dates (Rent date and back rent date) my bool(IsRented) should switch to true and when back rent date pass it should switch to false.
How to do it?
What exactly is the problem? Assigning values to boolean variables is trivial: myVar = true and myVar = false, but you likely have a different problem which you didn’t explain.
Sorry for my english.
I have boolean field in my Movies table.
I have 2 dates field in my Transaction field: 1st(when someone rent a movie) and 2nd(suggesting when someone will back rented movie).
My problem is to make my boolean field automaticly switch to true when TODAY(systemdateget()); between 1st and 2nd date. And vice versa: automaticly switch to false when TODAY(systemdateget()); is later or before than two this dates.
I hope now u understand me but if u can’t, just don’t pay your attention to me. [*-)]
You would need a batch that will check the situation every day and update the field as needed.
But maybe the real problem is in your design. Consider if you really need to save this information to database, because it can be easily calculated. If you use a calculated value, the whole problem about maintaining the value in database disappears.