Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / New Users / October 2007

Tip: Looking for answers? Try searching our database.

input mask for datetime field

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mcnews - 03 Oct 2007 17:50 GMT
is there an appropriate input mask for datetime fields?
one that prompts with the proper format, but will allow time portion
to be blank or default to all 0s?
John W. Vinson - 03 Oct 2007 19:14 GMT
>is there an appropriate input mask for datetime fields?

None, in my opinion. In general input masks just RESTRICT what the user can
type and remove flexibility. If any, then 00/00/00 (for folks who hate to type
slashes) for date-only data, 00/00/00\ 00:00 for hours and minutes in addition
to the date.

>one that prompts with the proper format, but will allow time portion
>to be blank or default to all 0s?

A Date/Time value is actually stored as a double float number, a count of days
and fractions of a day (times) since midnight, December 30, 1899. As such
there is ALWAYS a time portion; it can't be blank, because blank is a string -
not a number.

A date/time value with zeros past the decimal corresponds to midnight
(00:00:00). You can display it or not as you choose, by using an appropriate
format. What you can't do is have a format which shows times other than
midnight, and blank for midnight.

            John W. Vinson [MVP]
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.