>having the option of placing the dates between a defined period
Well, yes and no.
I suggest you have these MySQL fields and populate them this way
[pre]cDateString, dBeginDate, dEnddate
'20170700' , 2017-07-01, 2017-07-31
'20170000' , 2017-01-01, 2017-12-31
'20170723' , 2017-07-23, 2017-07-23[/pre]
In regard of sorting it now depends whether you sort by cDateString or one of the real date fields. And yes, that means you can find these quirky dates in date range searches better than via the wrong string date, eg searching in the range of the whole year 2017, unless you let that be a stringsearch starting with 20170000 instead of 20170101, this year string would not be found, but dBegindate would be found.
Griffs idea basicly just would convert to the dBegindate.
With both dBegindate and dEnddate you in general would sort in such 00 dates at begin or end of month or year, but for even larger ranges you want to query, say accumulating all data for a decade, these data ranges would not be left outside. So I was actually initially giving an example of a query with a range of dates to query and checking whether each record date range is within the query range, a range in range check.
As said, it makes querying not simpler. But it gives several ways of doing so.
Another example would be you actually want to query data of one sepcific date only, then you can decide to leave out any of these smeared undefined dates, but you could also consider making your query check the specific query date to be in each records range. For the records with a 1 day only range, this is exactly what you'd expect, but it woul also include all data assigned to the same month or year, if it's record date range is including the query date. That would be a day in range check, invere of what you normally do when querying all data for a range, you query all ranges covering a certain date.
Whether you want to include or exclude such data from queries has to be decided case by case. You just have the opportunity to do as you like when having data this way, it's up to you and your fantasy and capabilites to make use of the three values. Sorting by dBegindate would actually almost sort identical as by string, sorting by dEnddate would sort in all the unclear dates to the end of the range they belong to.
All in all this way of converting these dates doesn't set rules, but converts to the best known range of date values and what you do with that info in queries and sorting data then is up to you, but you have more options than with just the string date.
Bye, Olaf.