I have an access table with a 'Date' field. it has random dates for each record. I've built a script to append all the records into a list and then set the list to filter out only the unique values:
dateList = []
# cursor search through each record and append all records in the date
# field to a python list
for row in rows:
dateList.append(row.getValue("DATE_OBSERVATION").strftime('%m-%d-%Y'))
# Filter unique values to a set
newList = list(set(dateList))
This returns (on my test table):
['07-06-2010', '06-24-2010', '07-05-2010', '06-25-2010']
Now that I have the unique values for the "DATE_OBSERVATION" field, I want to detect if:
- the dates are single (i.e. only one unique date is returned because that is the date in every record)
- if the dates are a range of dates (i.e. all of the dates fall into a consecutive range)
- if the dates are multiple dates, but are not in a range of consecutive dates
Any suggestions would be much appreciated! Mike