convert date to julian date

G

Guest

Hello

I would like to have an unbound control in a form that calculates the julian
date (day of the year) from the date entered by the user in a bound filed,
"CDate". What's the best way to do this?

Thank you!
Christine
 
S

strive4peace

Hi Christine,

you can use

DatePart("y",[DateField])
to return an INTEGER representing the day of the year

OR

Format([datefield],"y")
to return a STRING representing the day of the year

ie:

1. make a calculated control
2. ControlSource -->
=DatePart("y",[DateField_controlname])

Warm Regards,
Crystal
MVP Microsoft Access

remote programming and training
strive4peace2006 at yahoo.com
*
Have an awesome day ;)
 
G

Guest

Thank you! This worked perfectly!

strive4peace said:
Hi Christine,

you can use

DatePart("y",[DateField])
to return an INTEGER representing the day of the year

OR

Format([datefield],"y")
to return a STRING representing the day of the year

ie:

1. make a calculated control
2. ControlSource -->
=DatePart("y",[DateField_controlname])

Warm Regards,
Crystal
MVP Microsoft Access

remote programming and training
strive4peace2006 at yahoo.com
*
Have an awesome day ;)

Hello

I would like to have an unbound control in a form that calculates the julian
date (day of the year) from the date entered by the user in a bound filed,
"CDate". What's the best way to do this?

Thank you!
Christine
 
S

strive4peace

You're welcome, Christine ;) happy to help

Warm Regards,
Crystal
MVP Microsoft Access

remote programming and training
strive4peace2006 at yahoo.com
*
Have an awesome day ;)

Thank you! This worked perfectly!

:

Hi Christine,

you can use

DatePart("y",[DateField])
to return an INTEGER representing the day of the year

OR

Format([datefield],"y")
to return a STRING representing the day of the year

ie:

1. make a calculated control
2. ControlSource -->
=DatePart("y",[DateField_controlname])

Warm Regards,
Crystal
MVP Microsoft Access

remote programming and training
strive4peace2006 at yahoo.com
*
Have an awesome day ;)

Hello

I would like to have an unbound control in a form that calculates the julian
date (day of the year) from the date entered by the user in a bound filed,
"CDate". What's the best way to do this?

Thank you!
Christine
 
G

Guest

I have tried the solution you posted and cannot get it to work... what am I
doing wrong???

On my form I have:
a text box named Julian_Year (Time/Date format in table) which is where I
want the 4 digit Julian Year.

I added an unbound text box to the form and followed your instructions:
1. make a calculated control
2. ControlSource -->
=DatePart("y",[DateField_controlname])
changing the =DatePart("y",[DateField_controlname])
to =DatePart("y",[DateField_Julian])

what did I do wrong?

strive4peace said:
Hi Christine,

you can use

DatePart("y",[DateField])
to return an INTEGER representing the day of the year

OR

Format([datefield],"y")
to return a STRING representing the day of the year

ie:

1. make a calculated control
2. ControlSource -->
=DatePart("y",[DateField_controlname])

Warm Regards,
Crystal
MVP Microsoft Access

remote programming and training
strive4peace2006 at yahoo.com
*
Have an awesome day ;)

Hello

I would like to have an unbound control in a form that calculates the julian
date (day of the year) from the date entered by the user in a bound filed,
"CDate". What's the best way to do this?

Thank you!
Christine
 

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

Similar Threads


Top