Hi Varun,
the data type of @prompt syntax. So we need to convert it to date to do date related operations on it. please refer below link. One more thing this is specific to sql server database.
One important this which i was supposed to mention and missing is, All these logic of getting data for previous month and previous year previous month etc will correctly only if user selects the date range within a single month. But if we selects the range across different months then you may not get the expected results. So check if you can provide the option of selecting the period than date range. ex: Apr2016 as the input for prompt