Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Aug 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Short Date & Short Time (97)

    Is there a way to set both the date & time to short format. With a default value of now?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Short Date & Short Time (97)

    Where do you want to do this? Do you want to set the default value of a Date/Time field in a table? Or do you want to set the value of a control on a form or report? Or do you mean something else entirely?

  3. #3
    New Lounger
    Join Date
    Aug 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Short Date & Short Time (97)

    I am trying to do this in a table.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Short Date & Short Time (97)

    Open a table in design view.
    The data type of the field this is about, must be Date/Time.
    There are two properties involved here:
    <UL><LI>The Format property determines how the field will be displayed. You can select a number of pre-defined formats from the dropdown list, or type a custom format. Among the pre-defined formats are "Short Date", "Long Date", "Short Time" and "Long Time". How they display depends on your system settings (Control Panel/Regional Settings); the dropdown list shows a bit of it.
    <LI>The DefaultValue property determines what value the field will have when you create a new record. If you want the default value to be the date the record is created, set it to
    =Date()
    If you want it to be the time the record is created, set this property to
    =Time()
    If you want it to be the date + time the record is created, set this property to
    =Now()[/list]Note: if you set DefaultValue to =Now() or =Time(), but select a date type Format, you won't see the time. analogously, if you set DefaultValue to =Date() and select a time type Format, you won't see the date. So it's important to set a Format that is related to the DefaultValue.

  5. #5
    4 Star Lounger
    Join Date
    Feb 2001
    Location
    Richland, Washington, USA
    Posts
    407
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Short Date & Short Time (97)

    Using a custom format gives you the most control over the appearance of your date/time. For example, specifying "m/d/yy h:n" (without the quotes) simulates the Short Date + Short Time predefined formats (depending on your system settings). Search Access help for "Format Property", then select "Date/Time Data Type" for all the options for custom formats.

    Hope this helps.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •