473,392 Members | 1,387 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,392 software developers and data experts.

Acess Date Code (Julian Date)

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 the syntax liek what
does DateAdd mean? If anyone can offer some good tutorials it would
be appreciated as well.

Thanks in advance.

Here is the code:

Format((DateAdd("d",-1,DateAdd("yyyy",
5,DateSerial(Year(Now()),Month(Now())+1,1))))-
DateSerial(Year(DateAdd("d",-1,DateAdd("yyyy",
5,DateSerial(Year(Now()),Month(Now())+1,1))))-1,12,31),"000") AS
[Julian Date]

Feb 5 '07 #1
4 14876
I'm not even trying to figure out your dateserial stuff. Rather, you
can use: format(date,"y") to get the proper Julian Date. Today is
36, btw.

As far as DateAdd, i think the help pretty much says it all. There
are different ways to increase/decrease a given date.

DateAdd (Interval, Number, Date)

Interval can be:
yyyy Year
q Quarter
m Month
y Day of year
d Day
w Weekday
ww Week
h Hour
n Minute
s Second

Number is items to add/subtract (you can subtract with a - number)
Date is the date to start with.

So, DateAdd("yyyy",1, Date()) will give you Feb 5, 2008.

Note, if you want to add days, you can also just add a number:
Date()+1 will give you Feb 6, 2007.
Date()-1 will give you Feb 4, 2007.
Chris Nebinger.
On Feb 5, 11:44 am, "IsdWeb" <rhayw...@isdweb.comwrote:
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 the syntax liek what
does DateAdd mean? If anyone can offer some good tutorials it would
be appreciated as well.

Thanks in advance.

Here is the code:

Format((DateAdd("d",-1,DateAdd("yyyy",
5,DateSerial(Year(Now()),Month(Now())+1,1))))-
DateSerial(Year(DateAdd("d",-1,DateAdd("yyyy",
5,DateSerial(Year(Now()),Month(Now())+1,1))))-1,12,31),"000") AS
[Julian Date]

Feb 5 '07 #2
Hi, Wow thats it?

How does the way know how to do this in the statment format(date,"y")?

Thanks a lot for your help, much appreciated! =)

Feb 5 '07 #3
On Feb 5, 5:37 pm, "IsdWeb" <rhayw...@isdweb.comwrote:
Hi, Wow thats it?

How does the way know how to do this in the statment format(date,"y")?
The VBA help file says that Format([date], "y") will...

"Display the day of the year as a number (1 - 366)."

So, if that's what you want then yes "that's it", except that it is
not a "Julian date". It is an "ordinal date", ref:

http://en.wikipedia.org/wiki/ISO_8601#Ordinal_dates

Feb 6 '07 #4
My experience with Julian Dates is the date of the year (at least
according to my time in the USAF).

If that's what you need, then save the date in a field. Then, in a
query, use this:

JulianDate:FOrmat([DateField],"y")

But, according to Wikipedia:

The term Julian date is also used to refer to:

Julian calendar dates
ordinal dates (day-of-year)
The use of Julian date to refer to the day-of-year (ordinal date) is
usually considered to be incorrect.
Which do you want?
Chris Nebinger
On Feb 6, 6:25 am, "Gord" <g...@kingston.netwrote:
On Feb 5, 5:37 pm, "IsdWeb" <rhayw...@isdweb.comwrote:
Hi, Wow thats it?
How does the way know how to do this in the statment format(date,"y")?

The VBA help file says that Format([date], "y") will...

"Display the day of the year as a number (1 - 366)."

So, if that's what you want then yes "that's it", except that it is
not a "Julian date". It is an "ordinal date", ref:

http://en.wikipedia.org/wiki/ISO_8601#Ordinal_dates

Feb 6 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Mick White | last post by:
According to the Safari browser the world began on "Fri Dec 13 1901 15:45:52 GMT-0500", but I need to be able to get around this limitation. I am interested in dates from 1500 to 1901, as far as...
5
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.
5
by: Dennis M. Marks | last post by:
After reading section 15.9.1.1 the ECMAScript Language Specifications I see that the date range for the Date function is +/- 100,000,000 days from 01 Jan 1970. This is called an extrapolated...
30
by: Dr John Stockton | last post by:
It has appeared that ancient sources give a method for Numeric Date Validation that involves numerous tests to determine month length; versions are often posted by incomers here. That sort of code...
9
by: Reggie | last post by:
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...
4
by: Russell | last post by:
I have an assignment that I have to complete. I have to write a windows app in C#. Here is the spec: 1/ Date Comparison Build a program that will find the number of days between two dates. You...
3
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....
29
by: james | last post by:
I have a problem that at first glance seems not that hard to figure out. But, so far, the answer has escaped me. I have an old database file that has the date(s) stored in it as number of days. An...
44
by: user | last post by:
Hi, Let's say I have 2 dates in the b/m format: Date 1 and date 2 How do I check whether Date2 is later than Date 1? Date1. 21-Nov-2006 09:00:00 PM
0
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...
0
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...
0
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.