Convert A Field (Date) In A Table To Julian Date

Pat/Ridders,

I'm running the code a button on the form. The statement is as follows:

Right(Year([NextPaymentDate]), 2) & DatePart("y", [NextPaymentDate])

Unfortunately, I'm not getting a leading zero for two (2) digits dates. If it possible to use the above command for two (2) digits date with a leading zero ?
 
You mean day 6 in 2018 is showing as 20186 and you want 201806?
If so, try this
Code:
Right(Year([NextPaymentDate]), 2) & Format(DatePart("y", [NextPaymentDate]),"00")

Or if you want three digits for day number e.g. 2018006 ; 2018056 ; 2018325 then
Code:
Right(Year([NextPaymentDate]), 2) & Format(DatePart("y", [NextPaymentDate]),"000")
 
Ridders,

That worked . . . Thanks ! ! !
 
Excellent.
Which of those did you actually mean?
 

Users who are viewing this thread

Back
Top Bottom