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!
--
Reggie
---------- 9 3678
On Fri, 17 Sep 2004 18:46:22 -0700, "Reggie"
<NoSpam_chief123101@NoSpam_yahoo.com> wrote:
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
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!
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))
--
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.
"Reggie" <NoSpam_chief123101@NoSpam_yahoo.com> wrote in message
news:A7********************@comcast.com... 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!
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!!!!
--
Reggie
----------
"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message
news:41***********************@per-qv1-newsreader-01.iinet.net.au... 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))
-- 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.
"Reggie" <NoSpam_chief123101@NoSpam_yahoo.com> wrote in message news:A7********************@comcast.com... 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!
Tom, Works great. One question though. How/why did you decide to use 1/17/93.
--
Reggie
----------
"Tom van Stiphout" <no*************@cox.net> wrote in message
news:8f********************************@4ax.com... On Fri, 17 Sep 2004 18:46:22 -0700, "Reggie" <NoSpam_chief123101@NoSpam_yahoo.com> wrote:
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
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!
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
--
Doug Steele, Microsoft Access MVP http://I.Am/DougSteele
(no e-mails, please!)
"Reggie" <NoSpam_chief123101@NoSpam_yahoo.com> wrote in message
news:-r********************@comcast.com... 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!!!!
-- Reggie
---------- "Allen Browne" <Al*********@SeeSig.Invalid> wrote in message news:41***********************@per-qv1-newsreader-01.iinet.net.au... 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))
-- 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.
"Reggie" <NoSpam_chief123101@NoSpam_yahoo.com> wrote in message news:A7********************@comcast.com... 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!
On Fri, 17 Sep 2004 22:09:10 -0700, "Reggie"
<NoSpam_chief123101@NoSpam_yahoo.com> wrote:
Simple:
Dateadd("d", -4023, #01/23/04#)
-Tom. Tom, Works great. One question though. How/why did you decide to use 1/17/93.
On Sat, 18 Sep 2004 11:48:44 GMT, "Douglas J. Steele"
<NOSPAM_djsteele@NOSPAM_canada.com> wrote:
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.
?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
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.
--
Doug Steele, Microsoft Access MVP http://I.Am/DougSteele
(no e-mails, please!)
"Tom van Stiphout" <no*************@cox.net> wrote in message
news:25********************************@4ax.com... On Sat, 18 Sep 2004 11:48:44 GMT, "Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote:
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.
?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
thelast 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
lastday 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
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!
--
Reggie
----------
"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
news:Ul*******************@twister01.bloor.is.net. cable.rogers.com... 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.
-- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "Tom van Stiphout" <no*************@cox.net> wrote in message news:25********************************@4ax.com... On Sat, 18 Sep 2004 11:48:44 GMT, "Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote:
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. > >?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
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: goochey |
last post by:
I'm trying to convert a Julian Date (Format "4365") into an actual calendar
date in Visual Basic, can anyone help me out with this.
|
by: sunny076 |
last post by:
Hi,
I am trying to convert from Julian to Gregorian data in C#. I was
exploring teh JulianCalendar and Gregorian calendar classes but still
not sure how I can do it. For example, the Julian date...
|
by: Chris Davoli |
last post by:
Is there a class that converts from Gregorian date to TRUE Julian Date in
..NET? Any VB.NET examples available?
ie;
The Julian date is calculated by the number of days since January 1, 4713
BC....
|
by: Karl O. Pinc |
last post by:
Hi,
What's the best way to obtain the Julian day from a postgresql
date?
PostgreSQL 7.3.4 on i386-redhat-linux-gnu, compiled by GCC
i386-redhat-linux-gcc (GCC) 3.2.2 20030222 (Red Hat Linux...
|
by: Rajat |
last post by:
Hi,
I have to draw a real time chart in which I have several entries at the same
second (i.e. HH:MM:SS:Milleconds)
The charting component only takes julian date for drawing the dates.
I am...
|
by: Bit byte |
last post by:
How may I represent dates as Julian dates - I have seen code where
julian dates are represented as longs, and other where they are
represented as floats. Which is the correct representation?
...
|
by: pdavis06 |
last post by:
I know that there is a thread about this, but I was unable to add to it; I just joined. The problem is that I do not want to change the date format for the entire database output, merely for a header...
|
by: IsdWeb |
last post by:
Hello,
I am a newbie to coding and need some help. I am trying to figure out
why the following code is not producing the correct Julian date. Any
suggestions? Also, I am trying to understand...
|
by: smdmca |
last post by:
I have Julian date, I want to convert it into date. Is there any function in MySql to convert Julian date to date
eg- Julian Date- 2455116
Date - Oct - 12, 2009
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |