Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
galbrecht
Starting Member
17 Posts |
Posted - 2007-02-13 : 02:15:28
|
HiI hav an application that record printing information. I am wanting to import the .log file that it creats into a sql db so that I can use RS ro create reports for our users. I have crerated a dts package to do the import - it all works fine untill I query the db - the date is in the format mm/dd/yyyy in the log file and therfore also in my sql db. The problem is that some of the date formats when quering show up as mm/dd/yyyy and the some of them appear as dd/mm/yyyy.Is there a way to force the query to convert the date type to dd/mm/yyyy (i have used convert(varchar(10)date, 103) as Date) but this does not work. Also could there be a better way using a SP. I am new the DBA so please bear with me and thank you in advance |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-02-13 : 02:40:12
|
Which datatype do you use when storing the date information in the table?If not using DATETIME or SMALLDATETIME, you really should consider this. When using proper datatypes, there is no problem later converting the, in this case, date to the format you want.Peter LarssonHelsingborg, Sweden |
 |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-02-13 : 02:43:25
|
i am a bit confuse.the date format in the log file is in mm/dd/yyyy right ? When you import the log file into the database, it is stored as string (varchar datatype) or as datetime ? KH |
 |
|
|
|
|