Welcome to SPN

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

Sign Up Now!

Date/Time in Number Format

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

  1. Jay

    Jay
    Expand Collapse
    Guest

    Thanks in advance.

    A query named Qry_Time_Table has fields such as Date, Start-Time...
    But these are numbers representing dates and times.
    Below are examples.
    (Ex) Date Start_Time
    38889 56001690

    (What I want to achieve)
    Date Start_Time
    6/21/06 6/21/06 09:30:00

    How can I change these numbers into Date/Time format in calculated fields of
    the query or vice versa?
     
  2. Loading...

    Similar Threads Forum Date
    Shabad Numbering System New to Sikhism Dec 1, 2015
    USA A Heart Attack And The Numbers Breaking News Aug 2, 2014
    Pacific Borneo: Sikhs small in number, strong in presence Breaking News Nov 11, 2013
    World Shrinking Numbers and Growing Persecution Threaten Sikhs and Hindus in Afghanistan Breaking News Nov 7, 2013
    SciTech Mammals pick offspring’s sex to maximize number of grandchildren, study shows Breaking News Jul 11, 2013

  3. John Vinson

    John Vinson
    Expand Collapse
    Guest

    On Wed, 21 Jun 2006 18:54:02 -0700, Jay
    <Jay@discussions.microsoft.com> wrote:

    >Thanks in advance.
    >
    >A query named Qry_Time_Table has fields such as Date, Start-Time...
    >But these are numbers representing dates and times.
    >Below are examples.
    >(Ex) Date Start_Time
    > 38889 56001690
    >
    >(What I want to achieve)
    > Date Start_Time
    > 6/21/06 6/21/06 09:30:00
    >
    >How can I change these numbers into Date/Time format in calculated fields of
    >the query or vice versa?


    Is this an Access table, or some external table? What are the
    datatypes of these two fields?

    Access Date/Time values are stored as Double Float numbers, a count of
    days and fractions of a day since midnight, December 30, 1899. 6/21/06
    is in fact 38889, as you can determine using the CDate() function:

    ?cdate(38889)
    6/21/2006

    but I can't see the logic of your Start_time value:

    ?cdbl(#6/21/06 09:30:00#)
    38889.3958333333

    Aha... maybe it's a long integer count of minutes:

    ?DateAdd("n", -56001690, #6/21/06 09:30:00#)
    12/29/1899 8:00:00 AM

    though what the 16 hours differance means is beyond me!

    John W. Vinson[MVP]
     
  4. strive4peace

    strive4peace
    Expand Collapse
    Guest

    Hi Jay,

    turn on the display of the Properties window

    (right-click anywhere and choose "Properties" from the
    shortcut menu)

    click in your column name

    set the Format property -- m/d/yy hh:nn:ss
    and press ENTER

    this will show you a time based on a 24-hour clock

    when you say this is what you want to archive... a format
    is a way of looking at something; it does not change what is
    stored -- you can change the format property of your
    archive table too.

    Warm Regards,
    Crystal
    Microsoft Access MVP 2006

    *
    Have an awesome day ;)

    remote programming and training
    strive4peace2006 at yahoo.com

    *

    Jay wrote:
    > Thanks in advance.
    >
    > A query named Qry_Time_Table has fields such as Date, Start-Time...
    > But these are numbers representing dates and times.
    > Below are examples.
    > (Ex) Date Start_Time
    > 38889 56001690
    >
    > (What I want to achieve)
    > Date Start_Time
    > 6/21/06 6/21/06 09:30:00
    >
    > How can I change these numbers into Date/Time format in calculated fields of
    > the query or vice versa?
    >
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page