Hello all,
I am trying to import an excel spreadsheet that has a specific date column. The column is saved as military time. For example, one of the records is:
04-12-2007 09:30
But, when i import the data into sql 2005, the above date is displayed as:
2007-04-12 09:30
I need it to display like the same way that it's being displayed in the excel spreadsheet.
My field in sql is nvarchar(100) and it still doesn't work.
Any ideas?
Thanks in advance.
Hi Friend,
You can play with the data at UI Level while binding the data you can change the Date Format as you wish, by the way are u using GridView to show the records ??
|||Hi You can also refer to http://support.microsoft.com/kb/173907Thanks...Akhil|||Nvarchar for dates is not recommended. You will not be able to sort by date or perform any date calculations, because your value will be treated as text. The recommended format for dates in Sql Server is YYYY-MM-DD hh:mm:ss. Once you extract a date/time value for display, you can fomat it in any way you want using the String.Format() method. Here are the expressions used to generate custom formats:http://blog.stevex.net/index.php/string-formatting-in-csharp/. The page is for C#, but the expressions are equally valid for VB.
No comments:
Post a Comment