In T-SQL how to handle [Expiration Date] = 'perpetual' or 'month-to-month' or 'dates vary'
I've been given 13 different spreadsheets that are currently used for tracking our companies contracts. They look like they were created by 13 different monkeys. No consistency between them, no data consistency within each one, multiple data stored in single fields. Those are the least of the issues with these Excel sheets. I have to import them into a MS SQL Server 2008 R2 table. /rant
Anyway... First question: Given the [Excel] column "Expiration Date" and understanding that this date [in the db table] is used in a PowerShell script to send an email alert to the contact person x days prior to the contract expiring:
How would you handle the following text entries from the spreadsheet in that date column with respect to what exactly should go into the date column and how would the various conditions be handled for the expiration warning alert message?
Entries in "Expiration Date" column:"6/30/2017" <-- That one is good. ;-)"month to month""perpetual""expiration dates vary""12 month subscription"
Those are the actual values in the expiration date column.
I hate using date "codes" like 1/1/1900 or 12/31/9999 to represent information in a data field and I doubt if the users of the database once it's done would be able to manage that complexity.
If not then in my opinion is impossible to "translate" int SQL WHERE clause something like "month to month"...
Maybe "perpetual" is also "good" as that means in my (poor) English this never expire as long as Customer.valid=true but anything else is a joke in my opinion without a "contract start date" or "contract effective date" datime column.