June 27, 2016 at 12:27 pm
I am using SQL Server 2008 I want to create a view. I have a field call inv_date and is numeric, a date field yymmdd what I want to do is convert it into mm/dd/yyyy and call the field Invoice_Date. I try to google in how to convert, but everything is for yyyymmdd format not yymmdd. All I want to do is to type in my view a date for example: Between 1/1/2016 and 6/24/2016. Any tip will be appreciated. Thank you in advance.
June 27, 2016 at 12:59 pm
Something like this?
SELECT CONVERT(date,CONVERT(char(6),'160627'),12)
Avoid storing dates as numbers or strings. Use date/time data types which will allow better performance and capabilities.
June 27, 2016 at 1:32 pm
Thanks
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply