Click here to Skip to main content
15,868,292 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hello


I have an excel sheet with dates in format dd-mm-yyyy and other data. I am trying to insert this into sql server 2005 table via importdata. When i do this , the data gets inserted as yyyy-mm-dd into the sql table. Keep in mind datetime type doesnt exist for sql 2005.

When the UI application runs and people make entries now..the same date column gets inserted as dd-mm-yyyy.

However search fails...I want both the entries in excel and the new entries made via UI to stick the dd-mm-yyyy format. So that search can be uniform and will not fail.

if there is a way I can change the imported from the excel in the table to the format of dd-mm-yyyy.Please let me know how to do it.

Please help.
Posted

1 solution

"Keep in mind datetime type doesnt exist for sql 2005."

What are you taking about?
Of course SQL2005 includes the DateTime data type!
http://technet.microsoft.com/en-us/library/ms187819(v=sql.105).aspx[^]

And that is clearly what is being used: otherwise you wouldn't be seeing ISO format dates in the SQL data.

I think you need to look at your search code: the problem is most likely there...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900