Hello, SQL2008R2
I could not think of a good way to search for this on the web.
I have a date in the format of ddmmyyyy imported from a CSV file.
Our default is mdy. I would prefer not to change the format (SET DATEFORMAT) but if that is the best way to handle things, okay.
I want to be able to compare the date column (VARCHAR(20)) with "ddmmyyyy" to a DATE data type column.
Should I just use something like
What about inserting it into a table which has a DATE column?
Thank you,
djj
The Lord is my shepherd (Psalm 23) - I need someone to lead me!
I could not think of a good way to search for this on the web.
I have a date in the format of ddmmyyyy imported from a CSV file.
Our default is mdy. I would prefer not to change the format (SET DATEFORMAT) but if that is the best way to handle things, okay.
I want to be able to compare the date column (VARCHAR(20)) with "ddmmyyyy" to a DATE data type column.
Should I just use something like
Code:
SET DATEFORMAT dmy
SELECT M.*
FROM Mytable M
INNER JOIN Mytable2 M2 ON M.IncomingDate = M2.DateColumn;
SET DATEFORMAT mdy
GO
Thank you,
djj
The Lord is my shepherd (Psalm 23) - I need someone to lead me!