Date literals can be enclosed within number signs (#) when using the "Date" data type.
Although when assigning a date to a Date variable this can also be done in a string format (eg Noon = #12:00:00# or #1/12/2002#. StartTime = Now().
When assigning a date to a date variable you can also use a valid date string format.
For example the following are all valid
Dim dtMyDate As Date
dtMyDate = #1/2/07#
dtMyDate = #7/7/06#
dtMyDate = #12:50:00 AM#
dtMyDate = "January 15, 2008"
dtMyDate = "2/7/06 12:55:00 PM"
You can also use double quotation marks but this is not very common and takes slightly longer to run
dtMyDate = ""7/7/06""
© 2020 Better Solutions Limited. All Rights Reserved. © 2020 Better Solutions Limited TopPrevNext