datediff function

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • chanchito_cojones

    #1

    datediff function

    i tried posting this earlier but it doesn't seem to have worked. So, i will
    try it again. =)

    I am trying to create a form where i have a text box that generates a
    persons age based on the info that is in their dateofbirth text box. I
    realize microsoft has a help file which tells one how to do it but it
    doesn't seem to work for me. I think this is due to the fact that my
    computer settings are a bit different than what microsoft was working with
    when they posted that help file. My computer is set to use the short date
    function (yy.mm.dd). And this data is how the DateofBirth field is setup.
    The input mask for this field is 00.99.99;0;_

    but when it comes to creating the age field it ask that one use this as its
    control source code:

    =DateDiff("yyyy ", [Birthdate], Now())+ Int( Format(now(), "mmdd") <
    Format( [Birthdate], "mmdd") )

    The problem with this is that say i have someone who is born 28.02.04 ...the
    number in the age field will be a negative number. Yet if their birthdate is
    73.02.01 it will properly generate a DOB of 31. So how do i get this all to
    work for me and my settings.

    thanks in advance.




  • Bob Quintal

    #2
    Re: datediff function

    "chanchito_cojo nes" <postonly@noema il.net> wrote in
    news:BKRuc.456$ yEo1.88@news04. bloor.is.net.ca ble.rogers.com:
    [color=blue]
    > i tried posting this earlier but it doesn't seem to have
    > worked. So, i will try it again. =)
    >[/color]
    Patience, Grasshopper. Your first post was only three hours ago,
    and has already been answered.


    Bob Quintal

    Comment

    Working...