I am trying to convert julian date format to a target field which is in datetime datatype in sqlserver.
I tried by using DateGenericGetDate function, but in transformer help it was given that the output will be in string format.But, I am looking to get the output as datetime data type.
Thanks in advance
date conversion from julian to sqlserver datetime datatype
Moderators: chulett, rschirm, roy
Clarify something. You've posted in the Server forum but marked the job type as Parallel. Plus you've referenced a function that sounds an awful lot like the sdk transforms that come with the Server product. Just want to make sure which job type this is in reference to.
Also, it would probably be prudent to clarify what you mean by 'Julian' date. Is it a real Julian date, which is the number of days from a certain base date? Or is it really an Ordinal date which is the year combined with the day number of the current date within that year?
Examples are always good.![Wink :wink:](./images/smilies/icon_wink.gif)
Also, it would probably be prudent to clarify what you mean by 'Julian' date. Is it a real Julian date, which is the number of days from a certain base date? Or is it really an Ordinal date which is the year combined with the day number of the current date within that year?
Examples are always good.
![Wink :wink:](./images/smilies/icon_wink.gif)
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Thanks for your reply
I guess the date is Ordinal date. example:2005191
Even though the job is developed in Parallel, I used Basic Transformer to use these DateGenericGetYear,DateGenericGetMonth and DateGenericGetDay functions.
I am getting this ordinal date with datatype as decimal(7).I want to convert this date and send that converted date in to target database SQLSERVER with datatype as datetime.
I guess the date is Ordinal date. example:2005191
Even though the job is developed in Parallel, I used Basic Transformer to use these DateGenericGetYear,DateGenericGetMonth and DateGenericGetDay functions.
I am getting this ordinal date with datatype as decimal(7).I want to convert this date and send that converted date in to target database SQLSERVER with datatype as datetime.
I'm sure there are parallel functions you can use, others would need to help with that. If you want to pursue a Server / BASIC Transformer solution then I'd suggest you look at the DateGenericToTimestamp sdk routine. It illustrates how to handle those Ordinal dates (what it calls 'Julian Year Days') via Iconv / Oconv.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Given that we're in the server edition forum, I'd say Craig has nailed it. That form of date can be converted with the "J" control in Iconv/Oconv. Here is an example:
Code: Select all
Oconv(Iconv(InLink.TheDate), "DYJ"), "D-YMD[4,2,2]")
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.