Re: Julian Date Conversion
Posted in 1997
Chris, here is something that you could try thought I'm not sure weather you want your julian date with 4 didgits or 7 but you can make this work either way. define c1 datetime year to day, m1 smallint, x1 varchar(7) let c1=<datetime value> let m1=1+(c1-mdy(1,1,year(c1))) let x1=year(c1),m1 this will make x1='1997161' if your datetime value was today. HTH. --- ,-, |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| ======= ___|| | | ----- //_ || | CANNON EXPRESS | ---- ,-----'| ~ | | | -- |o-----|__ |--`======_______________________________======___| ~~~~~~~~ `-(*)--===~~~~~~(*)(*)| (*)(*)| ------- ------------------------------------------------------------------------- Joseph Cullipher |E-mail: joseph@cannonexpress.com PO Box 364 |opinions express are those of my own and Springdale, AR 72764 USA |don't necessarily reflect those of my company ------------------------------------------------------------------------- On Tue, 10 Jun 1997, Chris Kaeberlein wrote: > Hello, fellow, Informix-ites. > > I'm in need of a function that will convert a datatype of DATETIME YEAR > TO DAY into a Julian date. I've searched all of the Informix literature > and CD documentation that I have at my disposal and haven't been able to > locate anything. The reason I need this function is that I need to > fragment a database table by the DATETIME field, and hopefully fragment > the data evenly across 4 fragments. However, I need to convert the > DATETIME field to a Julian value first in order to use the DATETIME > field in the fragmentation expression. Any help in this matter would be > much appreciated. > > TIA, > Chris > > -- > Chris Kaeberlein > Greenbrier and Russel, Inc. > ckaeberlein@gr.com >