Date format, day of the year = example 20=167 (1 Viewer)

access2010

Registered User.
Local time
Today, 15:43
Joined
Dec 26, 2009
Messages
1,021
Hello, how can we have the date in a form with the = Transaction Date = in this format = 20=167 =
which is the year 2020 (20), and the day of the year (167), this date would be entered with an existing Macro = Ctrl + D =

Thank you,
Nicole
 

Micron

AWF VIP
Local time
Today, 18:43
Joined
Oct 20, 2018
Messages
3,478
I don't do macros, but if you want an expression that might work,
Right(Year(date()),2) & " = " & datediff("d",#01/01/2020#,date() + 1)
Perhaps someone will think of a better one. If you're not going to provide an actual date value for the first day of the year, then you'll need something else.

Add & " = " on the end if you need a trailing equals sign.
 

cheekybuddha

AWF VIP
Local time
Today, 23:43
Joined
Jul 21, 2014
Messages
2,272
Hi Nicole,

You can try:
Format(Date, "yy\=") & (Int(Date) - Int(#2020-01-01#) + 1)
 

plog

Banishment Pending
Local time
Today, 17:43
Joined
May 11, 2011
Messages
11,638
Hello, how can we have the date in a form with the = Transaction Date = in this format = 20=167 =
which is the year 2020 (20), and the day of the year (167), this date would be entered with an existing Macro = Ctrl + D =

That doesn't really make complete sense without more context. Formatting data is a way to display data to people. Entering data via a form is a way to put data into a field in a table. Which does your form do? Are people putting it there or do they need to be able to look at it? I would assume if they are entering it, they would put it in as necessary.

If you have a date field in your table, the correct way to format it is like so (your use of equal signs is confusing as well):

Format([DateField],"= yy = y =")
 

Users who are viewing this thread

Top Bottom