473,473 Members | 1,831 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 14889
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
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,...
1
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.