I have a field called productiondate and the data looks like this 2-1-2012 or 12-25-2011 and its a nvarchar(50) value type.
i want to use substring and charindex to get the day month and year into seperate fields of day month year
so far i can do this below and it gets me the month, but i cant figure out how to get the day and year parsed out.
substring(prod_date,0,charindex('-',prod_date)) as 'month'
i want to use substring and charindex to get the day month and year into seperate fields of day month year
so far i can do this below and it gets me the month, but i cant figure out how to get the day and year parsed out.
substring(prod_date,0,charindex('-',prod_date)) as 'month'