Truncate date while using the Now() function [duplicate]
-
21-12-2019 - |
質問
I would like to know how to truncate a date when using the Now()
function to avoid having hours seconds and minutes. Effectively I would would like to show only dd/mmm/yyyy
.
My current code which is:
[Expected start date] = Now()
is returning in the field box:
13/04/2014 22:24:10
When i wish it would only return
13/04/2014
I imagine this may be simple for most but I am a beginner.
解決
How about using Format. You really don't want to set the Expected start date field to a date, but instead a string.
Format(Now(),"dd/mm/yyyy")
所属していません StackOverflow