Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 1 / September 2004

Tip: Looking for answers? Try searching our database.

Julian Date

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Reggie - 18 Sep 2004 02:46 GMT
Hi and TIA!  I have a field that I want to convert from Julian to a short date.  I've tried several
procedures, but can't come up with the right solution.  What I'm trying to do is convert

4023 to 01/23/04.

If you know of a solution or somewhere I can find the answer I would appreciate it.  Thanks for your
time!

Signature

Reggie

----------

Tom van Stiphout - 18 Sep 2004 04:24 GMT
DateAdd("d", 4023, #1/17/1993#)

-Tom.

>Hi and TIA!  I have a field that I want to convert from Julian to a short date.  I've tried several
>procedures, but can't come up with the right solution.  What I'm trying to do is convert
[quoted text clipped - 3 lines]
>If you know of a solution or somewhere I can find the answer I would appreciate it.  Thanks for your
>time!
Reggie - 18 Sep 2004 06:09 GMT
Tom,  Works great.  One question though.  How/why did you decide to use 1/17/93.

Signature

Reggie

----------

>
> DateAdd("d", 4023, #1/17/1993#)
[quoted text clipped - 10 lines]
>>your
>>time!
Tom van Stiphout - 18 Sep 2004 15:55 GMT
Simple:
Dateadd("d", -4023, #01/23/04#)
-Tom.

>Tom,  Works great.  One question though.  How/why did you decide to use 1/17/93.
Allen Browne - 18 Sep 2004 04:56 GMT
Is a Julian date the year concatenated with 3 digits representing the day of
the year?

If so, try something like this, where z is the field name:
   DateAdd("d", Right([z], 3), DateSerial(Left([z], Len([z])-3), 1, 0))

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> Hi and TIA!  I have a field that I want to convert from Julian to a short
> date.  I've tried several procedures, but can't come up with the right
[quoted text clipped - 4 lines]
> If you know of a solution or somewhere I can find the answer I would
> appreciate it.  Thanks for your time!
Reggie - 18 Sep 2004 05:40 GMT
Allen/Tom, Both of these produce the result I am looking for.  Now I'm going to try to figure out
how they work.  Thanks for your time!!!!

Signature

Reggie

----------

> Is a Julian date the year concatenated with 3 digits representing the day of the year?
>
[quoted text clipped - 8 lines]
>> If you know of a solution or somewhere I can find the answer I would appreciate it.  Thanks for
>> your time!
Douglas J. Steele - 18 Sep 2004 12:48 GMT
I wouldn't worry about figuring out why Tom's worked. It's not a generic
solution: it will not work for dates in 2003 or 2005, for instance.

?DateAdd("d", 3023, #1/17/1993#)
2001-04-28
?DateAdd("d", 5023, #1/17/1993#)
2006-10-19

On the other hand, Allen's works because it adds the number of days to the
last day of the previous year. Right(string, 3) gives you the last 3
characters of a string, while DateSerial(year, 1, 0), it gives you the last
day of the previous year.

?DateAdd("d", Right("3023", 3), DateSerial(Left("3023", Len("3023")-3), 1,
0))
2003-01-23
?DateAdd("d", Right("5023", 3), DateSerial(Left("5023", Len("5023")-3), 1,
0))
2005-01-23

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> Allen/Tom, Both of these produce the result I am looking for.  Now I'm going to try to figure out
> how they work.  Thanks for your time!!!!
[quoted text clipped - 11 lines]
> >> If you know of a solution or somewhere I can find the answer I would appreciate it.  Thanks for
> >> your time!
Tom van Stiphout - 18 Sep 2004 15:59 GMT
The OP spoke about julian days.
I just pointed out how they work. But I'm with everyone else:
1/17/1993 is a very curious begin date, and for me points out that it
is NOT a julian date. I was hoping the OP would come to that
conclusion himself.

-Tom.

>I wouldn't worry about figuring out why Tom's worked. It's not a generic
>solution: it will not work for dates in 2003 or 2005, for instance.
[quoted text clipped - 15 lines]
>0))
>2005-01-23
Douglas J. Steele - 18 Sep 2004 18:35 GMT
To many people, Julian Date is year and day of year, so that 4023 is the
23rd day of 2004.

And yes, I know that isn't actually a Julian Date.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> The OP spoke about julian days.
> I just pointed out how they work. But I'm with everyone else:
[quoted text clipped - 23 lines]
> >0))
> >2005-01-23
Reggie - 18 Sep 2004 21:03 GMT
Thanks again for all the help.  I know that 4023 isn't a Julian date, but this is government data
coming from a main frame and this is the format I get it in so gotta live with it.  Thank ya'll for
your time!

Signature

Reggie

----------

> To many people, Julian Date is year and day of year, so that 4023 is the
> 23rd day of 2004.
[quoted text clipped - 32 lines]
>> >0))
>> >2005-01-23
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.