I am trying to convert data imported into my app from nvarchar to date so I can compare the date with the current system date to ensure that past dates are not used.
The data is imported through the app into generic table where all columns are nvarchar (process cannot be changed), this results in me needing to convert the data type to compare the field with a date.
I have tried the following code to convert the date (TestData representing the column I am using in this instance):
CAST(TestData as date)
CONVERT(date, TestData)
Which is giving me an error message along the lines of: Cannot convert nvarchar to date.
Guessing I am missing something easy here, thought I'd try my luck here.