Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

date/time

Discussion in 'Information Technology' started by Bobcat, Jul 28, 2006.

  1. Bobcat

    Bobcat
    Expand Collapse
    Guest

    what is the correct syntex in the "Data Type" to show both Date and Time in
    the same field on a form.
     
  2. Steve Schapel

    Steve Schapel
    Expand Collapse
    Guest

    Bobcat,

    If you are talking about the Data Type of the field in the design of
    your table, you don't have any choice. Date/Time is the "Data Type".
    Into this field can be entered a date, or a time, or both. If you are
    using a control on a form to enter/edit/view this information, its
    *appearance* (as distinct from its value) will be determined by the
    Format property of the control, and for this you have a lot of
    flexibility. Not only that, but you can enter the data in one format,
    and it will immediately be displayed in the defined format. For
    example, you could have the Format prop[erty of the control on the form
    set to like this...
    mmm dd", "yyyy hh:nnam/pm
    .... and you could simply enter 7/23 or 23/7 (depending where you live)
    and you will immediately see:
    Jul 23, 2006 12:00am

    If this doesn't help answer your question, please post back with more
    details of waht you are trying to do.

    --
    Steve Schapel, Microsoft Access MVP

    Bobcat wrote:
    > what is the correct syntex in the "Data Type" to show both Date and Time in
    > the same field on a form.
     
  3. Bobcat

    Bobcat
    Expand Collapse
    Guest

    in the input mask i'm trying 99/99/00-00.00 (24hour) but it keeps telling me
    that it is wrong. I am redoing an existing database that someone else built,
    and need to convert the old (two fields) date/time fields to one field for
    calculations

    "Steve Schapel" wrote:

    > Bobcat,
    >
    > If you are talking about the Data Type of the field in the design of
    > your table, you don't have any choice. Date/Time is the "Data Type".
    > Into this field can be entered a date, or a time, or both. If you are
    > using a control on a form to enter/edit/view this information, its
    > *appearance* (as distinct from its value) will be determined by the
    > Format property of the control, and for this you have a lot of
    > flexibility. Not only that, but you can enter the data in one format,
    > and it will immediately be displayed in the defined format. For
    > example, you could have the Format prop[erty of the control on the form
    > set to like this...
    > mmm dd", "yyyy hh:nnam/pm
    > .... and you could simply enter 7/23 or 23/7 (depending where you live)
    > and you will immediately see:
    > Jul 23, 2006 12:00am
    >
    > If this doesn't help answer your question, please post back with more
    > details of waht you are trying to do.
    >
    > --
    > Steve Schapel, Microsoft Access MVP
    >
    > Bobcat wrote:
    > > what is the correct syntex in the "Data Type" to show both Date and Time in
    > > the same field on a form.

    >
     
  4. Steve Schapel

    Steve Schapel
    Expand Collapse
    Guest

    Bobcat,

    I myself would avoid using an Input Mask for dates and times. I am not
    sure what you hope to achieve by using such, but generally I would say
    it is unlikely to help anything. In any case, it would only apply to
    newly entered data, so is not relevant to your exisitng data.

    Having said that, I am not sure where you are located, but in most
    regions the time separator is a : not a . and I would also not use the -
    between the date and the time, so if you insisit on using an input mask
    I would try it more like this...
    90/90/0000 00:00

    --
    Steve Schapel, Microsoft Access MVP

    Bobcat wrote:
    > in the input mask i'm trying 99/99/00-00.00 (24hour) but it keeps telling me
    > that it is wrong. I am redoing an existing database that someone else built,
    > and need to convert the old (two fields) date/time fields to one field for
    > calculations
    >
     
  5. JK

    JK
    Expand Collapse
    Guest

    Hi Bobcat

    This assumes that in your regional settings of Windows the date separator is
    slash(/) and the time separator is colon:))

    The input mask should be 00/00/00\ 00:00;0;_

    The format is dd/mm/yy hh:nn (or mm/dd/yy hh:nn depending on where you
    are).
    If still want the dash and time separator displayed as dot the format is:
    dd/mm/yy"-"hh"."nn

    +++

    To combine the two fields from the old database:

    1.Import both of them into the New Table as say, oldDate, and oldTime
    2. Create a new Date Type Field say, dtDate
    3. Create an update Query
    4. Drag DtDate into the "Field:" row
    5: In the "Criteria:" type [oldDate]+[oldTime]
    6. Run the query
    7. If all is OK you can delete OldDate and OldTime from the new table

    Regard/JK




    "Bobcat" <Bobcat@discussions.microsoft.com> wrote in message
    news:434A9383-33F2-4269-9425-07238634ED95@microsoft.com...
    > in the input mask i'm trying 99/99/00-00.00 (24hour) but it keeps telling
    > me
    > that it is wrong. I am redoing an existing database that someone else
    > built,
    > and need to convert the old (two fields) date/time fields to one field for
    > calculations
    >
    > "Steve Schapel" wrote:
    >
    >> Bobcat,
    >>
    >> If you are talking about the Data Type of the field in the design of
    >> your table, you don't have any choice. Date/Time is the "Data Type".
    >> Into this field can be entered a date, or a time, or both. If you are
    >> using a control on a form to enter/edit/view this information, its
    >> *appearance* (as distinct from its value) will be determined by the
    >> Format property of the control, and for this you have a lot of
    >> flexibility. Not only that, but you can enter the data in one format,
    >> and it will immediately be displayed in the defined format. For
    >> example, you could have the Format prop[erty of the control on the form
    >> set to like this...
    >> mmm dd", "yyyy hh:nnam/pm
    >> .... and you could simply enter 7/23 or 23/7 (depending where you live)
    >> and you will immediately see:
    >> Jul 23, 2006 12:00am
    >>
    >> If this doesn't help answer your question, please post back with more
    >> details of waht you are trying to do.
    >>
    >> --
    >> Steve Schapel, Microsoft Access MVP
    >>
    >> Bobcat wrote:
    >> > what is the correct syntex in the "Data Type" to show both Date and
    >> > Time in
    >> > the same field on a form.

    >>
     

Share This Page