Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

date field 2

Status
Not open for further replies.

slim2

Programmer
Oct 18, 2001
94
0
0
Hello,

I have a field which is YYYYDDD the DDD is julian date. So 2002015 is 01/15/2002. I have tried every date conversion but cannot get it to work. Is there a way to convert this with a function.

Thanks in advance for any help.
 
how about try this
I will assume this is a string field,
"YYYYDDD" => {funnydate)

dateAdd("d",tonumber(right({funnyDate},3))-1,
date(tonumber(left({funnyDate},4)),01,01)

note I subtracted one from the DDD since our startdate is Jan 01 of the year Jim Broadbent
 
Dear Slim2,

This one also works:

//assuming that funnydate is a string

stringvar y;
stringvar d;
y := mid({@funnydate},1,4);
d := mid({@funnydate},5,7);

DateSerial (tonumber(y), 1, tonumber(d))

Hi, NGolem...


ro
Rosemary Lieberman
rosemary@microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.
 
Hey Jim, and Ro,

Thanks very much for the help it worked perfectly. You guys are great!

Les
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top