I'm currently in the middle of developing a reporting application with SQL Server on the back-end.
Data is ingested from csv files into tables. One of the files (with financial data) contains a financial period in the format of MM.YYYY (04.2015, 07.2016, etc.).
Later on people will want to query that data based on that period, for example anything between 04.2015 and 03.2016. Obviously running a between on strings will give you either no result or incorrect data.
What is the best way to handle this?
at the time of import convert to date (keeping in mind that datetime data type requires day)
cast/convert the string to date in the WHERE clause (how would you handle MM.YYYY in that case)
any other solutions?