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

access2010

Registered User.
Local time
Today, 11:14
Joined
Dec 26, 2009
Messages
633
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, 14:14
Joined
Oct 20, 2018
Messages
3,471
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, 19:14
Joined
Jul 21, 2014
Messages
557
Hi Nicole,

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

plog

Banishment Pending
Local time
Today, 13:14
Joined
May 11, 2011
Messages
10,260
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