In a datasheet, is there a way to format a datetime value with hour and minute only (no seconds) if there is a stored time value, but if the value stored is only a date, show as mm/dd/yyyy?
The goal is to have these outcomes:
enter a plain date 10/11/2023, show 10/11/2023
enter a date time value like 10/11/2023 7:30 am, show 10/11/2023 07:30 AM
enter a date time value like 10/11/2023 7:30:12 am, show 10/11/2023 07:30 AM (the seconds might come from Now())
Setting the format to mm/dd/yyyy hh:nn has the problem that hours and minutes are added to the plain date as 00:0.
This database is Access front end and back end.
I suppose the value shown could be plain text, converted from the date or datetime value in the query behind the form, but I'd prefer to use a formatting method to keep it simple. The field will be used for data entry, that means even more hoop-jumping to deal with if using the text presentation method.
The goal is to have these outcomes:
enter a plain date 10/11/2023, show 10/11/2023
enter a date time value like 10/11/2023 7:30 am, show 10/11/2023 07:30 AM
enter a date time value like 10/11/2023 7:30:12 am, show 10/11/2023 07:30 AM (the seconds might come from Now())
Setting the format to mm/dd/yyyy hh:nn has the problem that hours and minutes are added to the plain date as 00:0.
This database is Access front end and back end.
I suppose the value shown could be plain text, converted from the date or datetime value in the query behind the form, but I'd prefer to use a formatting method to keep it simple. The field will be used for data entry, that means even more hoop-jumping to deal with if using the text presentation method.
Last edited: