Welcome to SPN

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

Sign Up Now!
  1.   Become a Supporter    ::   Make a Contribution   
    Target (Recurring Monthly): $200 :: Achieved: $98

Date field in a table

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

Tags:
  1. CiceroCF

    CiceroCF
    Expand Collapse
    Guest

    I am trying to insert a date field in a table to show Month Year. I found
    the format and changed it to mmm yy. But when i put in months and years into
    the table, ie. Mar 06 Sep 05, it changes them to 06 Mar 06 and 05 Sep
    06. Is there away to change it so if i enter Mar 05 it will recognize it as
    Mar 2005 instead of 05 Mar 2006?
    Thanks for your help
    Carl
     
  2. Loading...


  3. OP
    Douglas J Steele

    Douglas J Steele
    Expand Collapse
    Guest

    Date fields must hold complete dates. This is because, under the covers, a
    date field is an 8 byte floating point number (where the integer portion
    represents the date as the number of days relative to 30 Dec, 1899, and the
    decimal portion represents the time as a fraction of a day).

    You'll either have to store month and year as separate fields, or decide
    that you'll always store, say, the 1st of the month, or the 15th of the
    month and use date field.

    --
    Doug Steele, Microsoft Access MVP
    http://I.Am/DougSteele
    (no e-mails, please!)


    "CiceroCF" <CiceroCF@discussions.microsoft.com> wrote in message
    news:4C1AC883-9028-45DD-BFB8-4D8B31107F15@microsoft.com...
    > I am trying to insert a date field in a table to show Month Year. I found
    > the format and changed it to mmm yy. But when i put in months and years

    into
    > the table, ie. Mar 06 Sep 05, it changes them to 06 Mar 06 and 05

    Sep
    > 06. Is there away to change it so if i enter Mar 05 it will recognize it

    as
    > Mar 2005 instead of 05 Mar 2006?
    > Thanks for your help
    > Carl
     
  4. OP
    CiceroCF

    CiceroCF
    Expand Collapse
    Guest

    i was afraid of that, just means a lil more typing for me then.

    Thanks for your help..
    Carl

    "Douglas J Steele" wrote:

    > Date fields must hold complete dates. This is because, under the covers, a
    > date field is an 8 byte floating point number (where the integer portion
    > represents the date as the number of days relative to 30 Dec, 1899, and the
    > decimal portion represents the time as a fraction of a day).
    >
    > You'll either have to store month and year as separate fields, or decide
    > that you'll always store, say, the 1st of the month, or the 15th of the
    > month and use date field.
    >
    > --
    > Doug Steele, Microsoft Access MVP
    > http://I.Am/DougSteele
    > (no e-mails, please!)
    >
    >
    > "CiceroCF" <CiceroCF@discussions.microsoft.com> wrote in message
    > news:4C1AC883-9028-45DD-BFB8-4D8B31107F15@microsoft.com...
    > > I am trying to insert a date field in a table to show Month Year. I found
    > > the format and changed it to mmm yy. But when i put in months and years

    > into
    > > the table, ie. Mar 06 Sep 05, it changes them to 06 Mar 06 and 05

    > Sep
    > > 06. Is there away to change it so if i enter Mar 05 it will recognize it

    > as
    > > Mar 2005 instead of 05 Mar 2006?
    > > Thanks for your help
    > > Carl

    >
    >
    >
     
  5. OP
    Douglas J Steele

    Douglas J Steele
    Expand Collapse
    Guest

    Not necessarily.

    If you store Year and Month as separate fields, you just have to provide
    values for them. You could even use combo boxes, to ensure no errors are
    made in the typing.

    Even if you use a date field, you could put code in the box's BeforeUpdate
    event to intercept what you typed and automatically add whatever day you
    selected. Since you've set the format to mmm yy, no one would be the wiser.

    --
    Doug Steele, Microsoft Access MVP
    http://I.Am/DougSteele
    (no e-mails, please!)


    "CiceroCF" <CiceroCF@discussions.microsoft.com> wrote in message
    news:07C595D7-FEB7-45E7-A2A3-CCE0E345C8B3@microsoft.com...
    > i was afraid of that, just means a lil more typing for me then.
    >
    > Thanks for your help..
    > Carl
    >
    > "Douglas J Steele" wrote:
    >
    > > Date fields must hold complete dates. This is because, under the covers,

    a
    > > date field is an 8 byte floating point number (where the integer portion
    > > represents the date as the number of days relative to 30 Dec, 1899, and

    the
    > > decimal portion represents the time as a fraction of a day).
    > >
    > > You'll either have to store month and year as separate fields, or decide
    > > that you'll always store, say, the 1st of the month, or the 15th of the
    > > month and use date field.
    > >
    > > --
    > > Doug Steele, Microsoft Access MVP
    > > http://I.Am/DougSteele
    > > (no e-mails, please!)
    > >
    > >
    > > "CiceroCF" <CiceroCF@discussions.microsoft.com> wrote in message
    > > news:4C1AC883-9028-45DD-BFB8-4D8B31107F15@microsoft.com...
    > > > I am trying to insert a date field in a table to show Month Year. I

    found
    > > > the format and changed it to mmm yy. But when i put in months and

    years
    > > into
    > > > the table, ie. Mar 06 Sep 05, it changes them to 06 Mar 06 and

    05
    > > Sep
    > > > 06. Is there away to change it so if i enter Mar 05 it will

    recognize it
    > > as
    > > > Mar 2005 instead of 05 Mar 2006?
    > > > Thanks for your help
    > > > Carl

    > >
    > >
    > >
     
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