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 |
|
nickmollberg
Starting Member
3 Posts |
Posted - 2005-08-29 : 10:24:45
|
| Anyone know the syntax for reformatting a date column like this?I need to convert date format 2004-08-31 to 08/31/2004 or, even better...How can I convert 2004-08-31 into a JULIAN date format?i.e. Julian Regular693596 = 1/1/1900732155 = 7/28/2005 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-08-29 : 10:30:49
|
| You can handle this type of Date formations in the Front End application or ReportsOtherwise use convert functionDeclare @t datetimeSet @t='2004-08-31'Select Convert(varchar,@t,101)What is the logic used in the Julian Dates?MadhivananFailing to plan is Planning to fail |
 |
|
|
Lumbago
Norsk Yak Master
3271 Posts |
Posted - 2005-08-29 : 16:08:52
|
| You should look up "convert" in books online..."101" in the select statement from madhivanan refers to a constant that can be found by looking in BOL for "convert".--Lumbago"Real programmers don't document, if it was hard to write it should be hard to understand" |
 |
|
|
nadejda18
Starting Member
7 Posts |
Posted - 2005-08-29 : 17:28:12
|
| If you mean julian format is a number of the days from the beginning of year, you can use DATEDIFF function:DATEDIFF ( dd , "01/01/2005", "your date" ) |
 |
|
|
DonAtWork
Master Smack Fu Yak Hacker
2167 Posts |
Posted - 2005-08-30 : 09:32:46
|
| *takes out bat*[ beat dead horse]FORMATING is handled on the CLIENT. [ /beat dead horse]Help us help YOU!Read this blog entry for more details: http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspx*need more coffee*SELECT * FROM Users WHERE CLUE > 0(0 row(s) affected) |
 |
|
|
|
|
|