Julian Date or Other Code Date

coffeeman

Registered User.
Local time
Today, 03:16
Joined
Oct 13, 2008
Messages
58
I am curious if there is a way to put in a production date in an entry on a form and have a cell auto calculate a julian date or a specific code date for a customer.

for example, today's production date would be 11/26/08. The Julian Date would be Yddd - Y('last digit year of date produced'), ddd('Julian day of year')

8331 - the 331st day of 2008.

Can someone help me with this?

I basically need this information to come up on the top of a report to let me know the julian date of the items produced that day.

Thanks
 
Not an easy way to do it, no function as far as I know... but I have never used Julian dates before...

It is easy enough to calculate what you want YYxxx where xxx is the day of the year.
This function
year(date()) & date() - dateserial(year(date()),1,0)
returns 2008331

So...
?int(mid(year(date()) & date() - dateserial(year(date()),1,0),2))
8331
 
Where do I enter this in?
 
Look up the Format() function. I think what you want is "yyddd". --- I would never use a one digit year. It is just asking for trouble.
 
You enter it in the query window as an expresion
JulianDate: Formula

Or

JulianDate: int(mid(year(date()) & date() - dateserial(year(date()),1,0),2))

@Pat
No sorry, DDD = two letter day, i.e. FR for friday for today.
 
For some reason my help wasn't working when I posted that so I guessed at the function. However, it turns out to be the DatePart() function that gives you the day of the year:
format(Date(),"yy") & Format(datepart("y",date()),"000")
 
It seems that Datepart is good "for something" afterall....

Although my function does the same... Datepart does look cleaner.
 
Yes DatePart() does seem to be redundent. They also used the same letter as they used for year so you can't even get the whole Julian date string with one function.
 

Users who are viewing this thread

Back
Top Bottom