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 |
|
dasu
Posting Yak Master
104 Posts |
Posted - 2004-10-28 : 01:30:23
|
| please send me the solution for how to convert julion data formatyyddd to standard date format like yyyy-mm-ddin vb script regardsdasu.g |
|
|
jonasalbert20
Constraint Violating Yak Guru
300 Posts |
Posted - 2004-10-28 : 01:50:00
|
| can you provide some data of your julion date? Pls.Want Philippines to become 1st World COuntry? Go for World War 3... |
 |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2004-10-28 : 02:06:10
|
| check for format function in vb...--------------------keeping it simple... |
 |
|
|
dasu
Posting Yak Master
104 Posts |
Posted - 2004-10-28 : 05:56:22
|
| i got the solution like this but i don know how it is working please explain especially about month'**********************************************************************' Visual Basic ActiveX Script'************************************************************************dim jFunction Main() j="03175" JDateToDate(j) Main = DTSTaskExecResult_SuccessEnd FunctionFunction JDateToDate(byval JDate ) Dim TheYearDim TheDayDim TheDateTheYear = CInt(Left(JDate, 2))If TheYear < 30 Then TheYear = TheYear + 2000Else TheYear = TheYear + 1900End IfTheDay = CInt(Right(JDate, 3))TheDate =DateSerial(TheYear, 1, TheDay)msgbox TheDateEnd Function |
 |
|
|
Arnold Fribble
Yak-finder General
1961 Posts |
Posted - 2004-10-28 : 06:41:01
|
| I wouldn't call that a Julian date: it's just the last two digits of the year with the day-of-year number concatenated onto it, together with some random assumption about the position of the window that determines what century it's in. In T-SQL:DATEADD(d, CAST(SUBSTRING(@jdate, 3, LEN(@jdate)) AS int), DATEADD(yy, CAST(LEFT(@jdate, 2) AS int) + CASE WHEN CAST(LEFT(@jdate, 2) AS int) < 30 THEN 100 ELSE 0 END, 0))Though that doesn't have any error checking. |
 |
|
|
|
|
|
|
|