I have two fields in table, (i) section_from & (ii) section_to, both fields has Date datatype, these fields tells us that this law section is enforced From(section_from) this date To(section_to) this date. The problem is, the latest law sections (active law) which are issued by the government has no specific To(section_to) date, Means we don't know what is the life of this law section maybe it is never changed from start to up-to-day or maybe government thinks after two months that this law section should be omitted or changed.

Is there anyway that, i mark the rows by ( Boolean attribute ) and tell the database that which rows have 1 value, update the section_to date with current date ?

4 Years
Discussion Span
Last Post by pritaeas

Why not leave the "section_to" value NULL (meaning no value). In your queries, you can then use IFNULL(section_to, NOW()). Once you know the correct end date, you can always fill it correctly.


what if the the user enter the date and ask for show the law section of that date ? How can i compare date in query with Null ?
where section_from => Date AND section_to <= Date

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.