1. Registered User
Join Date
Apr 2013
Posts
6

Dear brilliant friends,

I would like to store the today's day-number in a result-field.
For today, January 22nd, it should show 22. When it is October 9th, it should show 282.
You can calculate it by dateCurrent() - 01/01/2015, but this is not working when I use this as formule.
I checked the date-functions, but I did not find the solution.
How can I make it work?

Kind regards,

Dirk

## "Initial experiment using this: 1 [\$JulianDate] = dateDiff(dateSerial(2015,1,1),dateSerial(2015,11,2 ),|Day|) (for MPG) 2 Show Message ([\$juliandate], , Ok) You can substitute a field: 1 [\$JulianDate] = dateDiff(dateSerial(2015,1,1),[DateFilled],|Day|) (for MPG) 2 Show Message ([\$juliandate], , Ok) You can have a variable and a field: 1 [\$TestDate] = dateSerial(2014,01,01) (for MPG) 2 [\$JulianDate] = dateDiff([\$testdate],[DateFilled],|Day|) (for MPG) 3 Show Message ([\$juliandate], , Ok) Hope this helps. Bill"

3. Registered User
Join Date
Jul 2014
Posts
24
Initial experiment using this:

1 [\$JulianDate] = dateDiff(dateSerial(2015,1,1),dateSerial(2015,11,2 ),|Day|) (for MPG)
2 Show Message ([\$juliandate], , Ok)

You can substitute a field:

1 [\$JulianDate] = dateDiff(dateSerial(2015,1,1),[DateFilled],|Day|) (for MPG)
2 Show Message ([\$juliandate], , Ok)

You can have a variable and a field:

1 [\$TestDate] = dateSerial(2014,01,01) (for MPG)
2 [\$JulianDate] = dateDiff([\$testdate],[DateFilled],|Day|) (for MPG)
3 Show Message ([\$juliandate], , Ok)

Hope this helps.

Bill

4. Registered User
Join Date
Apr 2013
Posts
6

## Thank you

Dear Bill,

Brilliant solution. Nice to learn every day.

I changed the formula to dateDiff( [\$_date] , dateSerial(2016,1,1) , |Day| ) + 1
and it worked!

I only need to change the 2016 to a variable which contains the this year's year.

Dirk

5. Resident Curmudgeon
Join Date
Feb 2004
Location
In front of the computer
Posts
15,579
I'd cheat... Can you use:
Code:
`dateDiff([\$_date], dateSerial(Year([\$_date]), 1, 1) , |Day| ) + 1`
-PatP

6. Registered User
Join Date
Apr 2013
Location
USA
Posts
133