Julian Date Problem

T

Tom Rector

Before I start let me assure you I have been through the postings and
have not found this answer.

WIN XP ACCESS XP (2002)

I am working on a database that requires the julian date. The format
for the date is YYDDD or 04027 for Jan 27th. I can get the value of
0427 by entering yyy in the field properties 'format' property in the
form. I need a way to show the zero between yy(2 digit year) and y
(day of the year) when the day is less than 100, as in 04027 (2004 Jan
27th). For simplicity I want to do this within the form, field
properties.


Thanks for your support as always the many times you have helped me in
the past
Thomas Rector

(e-mail address removed)
 
K

Ken Snell

One way:

JulianDate = Format(Year([DateField]), "00") & Format(DatePart("y",
[DateField]), "000")
 
G

Graham Mandeno

Ken, that would give "2004027", because the "00" format specifies a
*minimum* of two digits.

Try:

JulianDate = Format([DateField], "yy") _
& Format(DatePart("y",[DateField]), "000")

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Ken Snell said:
One way:

JulianDate = Format(Year([DateField]), "00") & Format(DatePart("y",
[DateField]), "000")

--
Ken Snell
<MS ACCESS MVP>

Tom Rector said:
Before I start let me assure you I have been through the postings and
have not found this answer.

WIN XP ACCESS XP (2002)

I am working on a database that requires the julian date. The format
for the date is YYDDD or 04027 for Jan 27th. I can get the value of
0427 by entering yyy in the field properties 'format' property in the
form. I need a way to show the zero between yy(2 digit year) and y
(day of the year) when the day is less than 100, as in 04027 (2004 Jan
27th). For simplicity I want to do this within the form, field
properties.


Thanks for your support as always the many times you have helped me in
the past
Thomas Rector

(e-mail address removed)
 
K

Ken Snell

Quite right.....thanks for the catch, Graham.

--
Ken Snell
<MS ACCESS MVP>


Graham Mandeno said:
Ken, that would give "2004027", because the "00" format specifies a
*minimum* of two digits.

Try:

JulianDate = Format([DateField], "yy") _
& Format(DatePart("y",[DateField]), "000")

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Ken Snell said:
One way:

JulianDate = Format(Year([DateField]), "00") & Format(DatePart("y",
[DateField]), "000")

--
Ken Snell
<MS ACCESS MVP>

Tom Rector said:
Before I start let me assure you I have been through the postings and
have not found this answer.

WIN XP ACCESS XP (2002)

I am working on a database that requires the julian date. The format
for the date is YYDDD or 04027 for Jan 27th. I can get the value of
0427 by entering yyy in the field properties 'format' property in the
form. I need a way to show the zero between yy(2 digit year) and y
(day of the year) when the day is less than 100, as in 04027 (2004 Jan
27th). For simplicity I want to do this within the form, field
properties.


Thanks for your support as always the many times you have helped me in
the past
Thomas Rector

(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top