Date Problem
-
hei all, I'm now working in Norwegian environment where date formate is like this DD.MM.YYYY so when i write query in SQL 2000 like this
SELECT joinDate FROM myTable WHERE (joinDate>= '01.01.2009') AND (joinDate<= '01.01.2010')
it gives error And I cant convert date format. Any ideat will be most welcome. ThanksSyed Shahid Hussain
-
hei all, I'm now working in Norwegian environment where date formate is like this DD.MM.YYYY so when i write query in SQL 2000 like this
SELECT joinDate FROM myTable WHERE (joinDate>= '01.01.2009') AND (joinDate<= '01.01.2010')
it gives error And I cant convert date format. Any ideat will be most welcome. ThanksSyed Shahid Hussain
-
Thanks. But the problem is that from application how can i change the date format, should i wirite a function that get dd.mm.yyyy and then return into yyyy-mm-dd Any suggestion from u. Thanks
Syed Shahid Hussain
-
hei all, I'm now working in Norwegian environment where date formate is like this DD.MM.YYYY so when i write query in SQL 2000 like this
SELECT joinDate FROM myTable WHERE (joinDate>= '01.01.2009') AND (joinDate<= '01.01.2010')
it gives error And I cant convert date format. Any ideat will be most welcome. ThanksSyed Shahid Hussain
If joinDate is a DateTime type, then this should work:
joinDate >= CONVERT(DATETIME, '01.01.2009', 104)
This is fully documented in the SQL Server documentation, which is all available on line.
-
If joinDate is a DateTime type, then this should work:
joinDate >= CONVERT(DATETIME, '01.01.2009', 104)
This is fully documented in the SQL Server documentation, which is all available on line.
oh really thanks David its great :rose:
Syed Shahid Hussain
-
hei all, I'm now working in Norwegian environment where date formate is like this DD.MM.YYYY so when i write query in SQL 2000 like this
SELECT joinDate FROM myTable WHERE (joinDate>= '01.01.2009') AND (joinDate<= '01.01.2010')
it gives error And I cant convert date format. Any ideat will be most welcome. ThanksSyed Shahid Hussain
Parse the strings to DateTime and use a parameterized query.
-
Parse the strings to DateTime and use a parameterized query.
thanks :rose:
Syed Shahid Hussain