Loading ...
Sorry, an error occurred while loading the content.

Re: Lahman DB and Age Calculation

Expand Messages
  • Charles
    I ve run into the same problem (a week or so ago actually). I m not sure what I ve done different since, but this seems to work: SELECT Master.playerID,
    Message 1 of 24 , Mar 7, 2007
    • 0 Attachment
      I've run into the same problem (a week or so ago actually). I'm not
      sure what I've done different since, but this seems to work:

      SELECT Master.playerID, Pitching.yearID,
      DateDiff("yyyy",DateValue([birthmonth] & '/' & [birthday] & '/' &
      [birthyear]),DateValue("07/01/" & [Pitching].[yearID])) AS AGE
      FROM [primary position] INNER JOIN (Master INNER JOIN Pitching ON
      Master.playerID = Pitching.playerID) ON ([primary position].yearID =
      Pitching.yearID) AND ([primary position].teamID = Pitching.teamID) AND
      ([primary position].player = Pitching.playerID)
      WHERE (((DateDiff("yyyy",DateValue([birthmonth] & '/' & [birthday] &
      '/'
      & [birthyear]),DateValue("07/01/" & [Pitching].[yearID])))=26) AND
      ((Master.birthYear) Is Not Null) AND ((Master.birthMonth) Is Not Null)
      AND ((Master.birthDay) Is Not Null));

      I'm sure there's a cleaner way to do it, but I'm pretty certain this
      will work. If you do a search and replace for "pitching"->"batting"
      you can get all hitters aged 26.

      --- In baseball-databank@yahoogroups.com, "btibert3" <btibert3@...> wrote:
      >
      > I am using the current release of Sean's DB and I am trying to
      > calculate the age for each pitcher with the following SQL:
      >
      > SELECT Pitching.playerID, Pitching.yearID, DateDiff("yyyy",DateSerial
      > ([Master]![birthYear],[Master]![birthMonth],[Master]!
      > [birthDay]),DateSerial([Pitching]![yearID],7,1)) AS Age
      > FROM Pitching INNER JOIN Master ON Pitching.playerID =
      > Master.playerID
      > WHERE DateDiff("yyyy",DateSerial([Master]![birthYear],[Master]!
      > [birthMonth],[Master]![birthDay]),DateSerial([Pitching]!
      > [yearID],7,1))=26;
      >
      >
      > When I run this, I get a "Data type mismatch in the criteria
      > expression" error. I only get this error when I try to filter out
      > the performance of a pitcher for a certain age. Simply put, when I
      > run the calc as is, it runs fine (seemingly).
      >
      > I am stumped. By no means am I a DBA, but I am fairly comfortable
      > with Access and data manipulation.
      >
      > Do I have a corrupt version of Access? Has anyone run into the same
      > problem? Someone have a better way to calculate age at run time?
      >
      > Many thanks guys,
      >
      > ~ Brock
      >
    • Charles
      Oops, I take it back, that query included an extra table I made up (from a tangotiger query) that included positions for batters. This one should be compliant
      Message 2 of 24 , Mar 7, 2007
      • 0 Attachment
        Oops, I take it back, that query included an extra table I made up
        (from a tangotiger query) that included positions for batters. This
        one should be compliant with Sean's DB without any changes. I believe
        that you have to check for null values to prevent the query from
        crashing when you try to sort/set a criteria.

        SELECT Master.playerID, Pitching.yearID,
        DateDiff("yyyy",DateValue([birthmonth] & '/' & [birthday] & '/' &
        [birthyear]),DateValue("07/01/" & [Pitching].[yearID])) AS AGE
        FROM Master INNER JOIN Pitching ON Master.playerID = Pitching.playerID
        WHERE (((DateDiff("yyyy",DateValue([birthmonth] & '/' & [birthday] &
        '/' & [birthyear]),DateValue("07/01/" & [Pitching].[yearID])))=26) AND
        ((Master.birthYear) Is Not Null) AND ((Master.birthMonth) Is Not Null)
        AND ((Master.birthDay) Is Not Null));

        --- In baseball-databank@yahoogroups.com, "Charles" <chazcreasy1@...>
        wrote:
        >
        > I've run into the same problem (a week or so ago actually). I'm not
        > sure what I've done different since, but this seems to work:
        >
        > SELECT Master.playerID, Pitching.yearID,
        > DateDiff("yyyy",DateValue([birthmonth] & '/' & [birthday] & '/' &
        > [birthyear]),DateValue("07/01/" & [Pitching].[yearID])) AS AGE
        > FROM [primary position] INNER JOIN (Master INNER JOIN Pitching ON
        > Master.playerID = Pitching.playerID) ON ([primary position].yearID =
        > Pitching.yearID) AND ([primary position].teamID = Pitching.teamID) AND
        > ([primary position].player = Pitching.playerID)
        > WHERE (((DateDiff("yyyy",DateValue([birthmonth] & '/' & [birthday] &
        > '/'
        > & [birthyear]),DateValue("07/01/" & [Pitching].[yearID])))=26) AND
        > ((Master.birthYear) Is Not Null) AND ((Master.birthMonth) Is Not Null)
        > AND ((Master.birthDay) Is Not Null));
        >
        > I'm sure there's a cleaner way to do it, but I'm pretty certain this
        > will work. If you do a search and replace for "pitching"->"batting"
        > you can get all hitters aged 26.
        >
        > --- In baseball-databank@yahoogroups.com, "btibert3" <btibert3@> wrote:
        > >
        > > I am using the current release of Sean's DB and I am trying to
        > > calculate the age for each pitcher with the following SQL:
        > >
        > > SELECT Pitching.playerID, Pitching.yearID, DateDiff("yyyy",DateSerial
        > > ([Master]![birthYear],[Master]![birthMonth],[Master]!
        > > [birthDay]),DateSerial([Pitching]![yearID],7,1)) AS Age
        > > FROM Pitching INNER JOIN Master ON Pitching.playerID =
        > > Master.playerID
        > > WHERE DateDiff("yyyy",DateSerial([Master]![birthYear],[Master]!
        > > [birthMonth],[Master]![birthDay]),DateSerial([Pitching]!
        > > [yearID],7,1))=26;
        > >
        > >
        > > When I run this, I get a "Data type mismatch in the criteria
        > > expression" error. I only get this error when I try to filter out
        > > the performance of a pitcher for a certain age. Simply put, when I
        > > run the calc as is, it runs fine (seemingly).
        > >
        > > I am stumped. By no means am I a DBA, but I am fairly comfortable
        > > with Access and data manipulation.
        > >
        > > Do I have a corrupt version of Access? Has anyone run into the same
        > > problem? Someone have a better way to calculate age at run time?
        > >
        > > Many thanks guys,
        > >
        > > ~ Brock
        > >
        >
      • Tangotiger
        If all you require is an integer for an age, may I suggest simply doing: yearid - birthyear. Who really cares whether the guy was born Jun 30 or Jul 2, or Dec
        Message 3 of 24 , Mar 7, 2007
        • 0 Attachment
          If all you require is an integer for an age, may I
          suggest simply doing: yearid - birthyear.

          Who really cares whether the guy was born Jun 30 or
          Jul 2, or Dec 30 or Jan 2? Whatever you do, it's a
          rounded age.

          Tom



          --- Charles <chazcreasy1@...> wrote:

          > I've run into the same problem (a week or so ago
          > actually). I'm not
          > sure what I've done different since, but this seems
          > to work:
          >
          > SELECT Master.playerID, Pitching.yearID,
          > DateDiff("yyyy",DateValue([birthmonth] & '/' &
          > [birthday] & '/' &
          > [birthyear]),DateValue("07/01/" &
          > [Pitching].[yearID])) AS AGE
          > FROM [primary position] INNER JOIN (Master INNER
          > JOIN Pitching ON
          > Master.playerID = Pitching.playerID) ON ([primary
          > position].yearID =
          > Pitching.yearID) AND ([primary position].teamID =
          > Pitching.teamID) AND
          > ([primary position].player = Pitching.playerID)
          > WHERE (((DateDiff("yyyy",DateValue([birthmonth] &
          > '/' & [birthday] &
          > '/'
          > & [birthyear]),DateValue("07/01/" &
          > [Pitching].[yearID])))=26) AND
          > ((Master.birthYear) Is Not Null) AND
          > ((Master.birthMonth) Is Not Null)
          > AND ((Master.birthDay) Is Not Null));
          >
          > I'm sure there's a cleaner way to do it, but I'm
          > pretty certain this
          > will work. If you do a search and replace for
          > "pitching"->"batting"
          > you can get all hitters aged 26.
          >
          > --- In baseball-databank@yahoogroups.com, "btibert3"
          > <btibert3@...> wrote:
          > >
          > > I am using the current release of Sean's DB and I
          > am trying to
          > > calculate the age for each pitcher with the
          > following SQL:
          > >
          > > SELECT Pitching.playerID, Pitching.yearID,
          > DateDiff("yyyy",DateSerial
          > >
          >
          ([Master]![birthYear],[Master]![birthMonth],[Master]!
          > > [birthDay]),DateSerial([Pitching]![yearID],7,1))
          > AS Age
          > > FROM Pitching INNER JOIN Master ON
          > Pitching.playerID =
          > > Master.playerID
          > > WHERE
          >
          DateDiff("yyyy",DateSerial([Master]![birthYear],[Master]!
          > >
          >
          [birthMonth],[Master]![birthDay]),DateSerial([Pitching]!
          > > [yearID],7,1))=26;
          > >
          > >
          > > When I run this, I get a "Data type mismatch in
          > the criteria
          > > expression" error. I only get this error when I
          > try to filter out
          > > the performance of a pitcher for a certain age.
          > Simply put, when I
          > > run the calc as is, it runs fine (seemingly).
          > >
          > > I am stumped. By no means am I a DBA, but I am
          > fairly comfortable
          > > with Access and data manipulation.
          > >
          > > Do I have a corrupt version of Access? Has anyone
          > run into the same
          > > problem? Someone have a better way to calculate
          > age at run time?
          > >
          > > Many thanks guys,
          > >
          > > ~ Brock
          > >
          >
          >
          >


          ---------------------------------------------
          http://www.InsideTheBook.com
          The Book--Playing The Percentages In Baseball











          -----------------------------------



          ____________________________________________________________________________________
          We won't tell. Get more on shows you hate to love
          (and love to hate): Yahoo! TV's Guilty Pleasures list.
          http://tv.yahoo.com/collections/265
        • Sean Forman
          I generally use yearid - birthyear + (birthmonth 6) The birthmonth 6 is computed as a boolean, so it is either 1 or 0 depending on whether it is true or
          Message 4 of 24 , Mar 7, 2007
          • 0 Attachment
            I generally use

            yearid - birthyear + (birthmonth > 6) 

            The birthmonth > 6 is computed as a boolean, so it is either 1 or 0 depending on whether it is true or not.  I'm not sure if that works in access or not.

            sean

            On 3/7/07, Tangotiger <tangotiger@...> wrote:

            If all you require is an integer for an age, may I
            suggest simply doing: yearid - birthyear.

            Who really cares whether the guy was born Jun 30 or
            Jul 2, or Dec 30 or Jan 2? Whatever you do, it's a
            rounded age.

            Tom



            --- Charles <chazcreasy1@...> wrote:

            > I've run into the same problem (a week or so ago
            > actually). I'm not
            > sure what I've done different since, but this seems
            > to work:
            >
            > SELECT Master.playerID, Pitching.yearID,
            > DateDiff("yyyy",DateValue([birthmonth] & '/' &
            > [birthday] & '/' &
            > [birthyear]),DateValue("07/01/" &
            > [Pitching].[yearID])) AS AGE
            > FROM [primary position] INNER JOIN (Master INNER
            > JOIN Pitching ON
            > Master.playerID = Pitching.playerID) ON ([primary
            > position].yearID =
            > Pitching.yearID) AND ([primary position].teamID =
            > Pitching.teamID) AND
            > ([primary position].player = Pitching.playerID)
            > WHERE (((DateDiff("yyyy",DateValue([birthmonth] &
            > '/' & [birthday] &
            > '/'
            > & [birthyear]),DateValue("07/01/" &
            > [Pitching].[yearID])))=26) AND
            > ((Master.birthYear) Is Not Null) AND
            > ((Master.birthMonth) Is Not Null)
            > AND ((Master.birthDay) Is Not Null));
            >
            > I'm sure there's a cleaner way to do it, but I'm
            > pretty certain this
            > will work. If you do a search and replace for
            > "pitching"->"batting"
            > you can get all hitters aged 26.
            >
            > --- In baseball-databank@yahoogroups.com, "btibert3"
            > <btibert3@...> wrote:
            > >
            > > I am using the current release of Sean's DB and I
            > am trying to
            > > calculate the age for each pitcher with the
            > following SQL:
            > >
            > > SELECT Pitching.playerID, Pitching.yearID,
            > DateDiff("yyyy",DateSerial
            > >
            >
            ([Master]![birthYear],[Master]![birthMonth],[Master]!
            > > [birthDay]),DateSerial([Pitching]![yearID],7,1))
            > AS Age
            > > FROM Pitching INNER JOIN Master ON
            > Pitching.playerID =
            > > Master.playerID
            > > WHERE
            >
            DateDiff("yyyy",DateSerial([Master]![birthYear],[Master]!
            > >
            >
            [birthMonth],[Master]![birthDay]),DateSerial([Pitching]!
            > > [yearID],7,1))=26;
            > >
            > >
            > > When I run this, I get a "Data type mismatch in
            > the criteria
            > > expression" error. I only get this error when I
            > try to filter out
            > > the performance of a pitcher for a certain age.
            > Simply put, when I
            > > run the calc as is, it runs fine (seemingly).
            > >
            > > I am stumped. By no means am I a DBA, but I am
            > fairly comfortable
            > > with Access and data manipulation.
            > >
            > > Do I have a corrupt version of Access? Has anyone
            > run into the same
            > > problem? Someone have a better way to calculate
            > age at run time?
            > >
            > > Many thanks guys,
            > >
            > > ~ Brock
            > >
            >
            >
            >

            ---------------------------------------------
            http://www.InsideTheBook.com
            The Book--Playing The Percentages In Baseball

            -----------------------------------

            __________________________________________________________
            We won't tell. Get more on shows you hate to love
            (and love to hate): Yahoo! TV's Guilty Pleasures list.
            http://tv.yahoo.com/collections/265




            --
            --
            Sincerely,        
            Sean Forman

            Baseball Stats!  http://www.Baseball-Reference.com/
            SR Blog!           http://www.Baseball-Reference.com/blog/
          • Keith Hemmelman
            I was using a IIF statement in my Access 2000 database to calculate the age as of July 1 in a query. I just tried Sean s formula which is probably more
            Message 5 of 24 , Mar 7, 2007
            • 0 Attachment
              I was using a IIF statement in my Access 2000 database to calculate the age as of July 1 in a query.  I just tried Sean's formula which is probably more efficient than what I used and it gave the exact same results, so it works fine.
               
              Keith Hemmelman
               
              -----Original Message-----
              From: baseball-databank@yahoogroups.com [mailto:baseball-databank@yahoogroups.com]On Behalf Of Sean Forman
              Sent: Wednesday, March 07, 2007 6:41 PM
              To: baseball-databank@yahoogroups.com
              Subject: Re: [baseball-databank] Re: Lahman DB and Age Calculation

              I generally use

              yearid - birthyear + (birthmonth > 6) 

              The birthmonth > 6 is computed as a boolean, so it is either 1 or 0 depending on whether it is true or not.  I'm not sure if that works in access or not.

              sean

              .

            • John Walsh
              Shouldn t that be yearid - birthyear - (birthmonth 6) ?
              Message 6 of 24 , Mar 8, 2007
              • 0 Attachment
                Shouldn't that be

                yearid - birthyear - (birthmonth > 6)

                ?


                On 3/8/07, Sean Forman < sean-forman@...> wrote:

                I generally use

                yearid - birthyear + (birthmonth > 6) 

                The birthmonth > 6 is computed as a boolean, so it is either 1 or 0 depending on whether it is true or not.  I'm not sure if that works in access or not.

                sean



                On 3/7/07, Tangotiger < tangotiger@...> wrote:

                If all you require is an integer for an age, may I
                suggest simply doing: yearid - birthyear.

                Who really cares whether the guy was born Jun 30 or
                Jul 2, or Dec 30 or Jan 2? Whatever you do, it's a
                rounded age.

                Tom



                --- Charles <chazcreasy1@...> wrote:

                > I've run into the same problem (a week or so ago
                > actually). I'm not
                > sure what I've done different since, but this seems
                > to work:
                >
                > SELECT Master.playerID, Pitching.yearID,
                > DateDiff("yyyy",DateValue([birthmonth] & '/' &
                > [birthday] & '/' &
                > [birthyear]),DateValue("07/01/" &
                > [Pitching].[yearID])) AS AGE
                > FROM [primary position] INNER JOIN (Master INNER
                > JOIN Pitching ON
                > Master.playerID = Pitching.playerID) ON ([primary
                > position].yearID =
                > Pitching.yearID) AND ([primary position].teamID =
                > Pitching.teamID) AND
                > ([primary position].player = Pitching.playerID)
                > WHERE (((DateDiff("yyyy",DateValue([birthmonth] &
                > '/' & [birthday] &
                > '/'
                > & [birthyear]),DateValue("07/01/" &
                > [Pitching].[yearID])))=26) AND
                > ((Master.birthYear) Is Not Null) AND
                > ((Master.birthMonth) Is Not Null)
                > AND ((Master.birthDay) Is Not Null));
                >
                > I'm sure there's a cleaner way to do it, but I'm
                > pretty certain this
                > will work. If you do a search and replace for
                > "pitching"->"batting"
                > you can get all hitters aged 26.
                >
                > --- In baseball-databank@yahoogroups.com, "btibert3"
                > <btibert3@...> wrote:
                > >
                > > I am using the current release of Sean's DB and I
                > am trying to
                > > calculate the age for each pitcher with the
                > following SQL:
                > >
                > > SELECT Pitching.playerID, Pitching.yearID,
                > DateDiff("yyyy",DateSerial
                > >
                >
                ([Master]![birthYear],[Master]![birthMonth],[Master]!
                > > [birthDay]),DateSerial([Pitching]![yearID],7,1))
                > AS Age
                > > FROM Pitching INNER JOIN Master ON
                > Pitching.playerID =
                > > Master.playerID
                > > WHERE
                >
                DateDiff("yyyy",DateSerial([Master]![birthYear],[Master]!
                > >
                >
                [birthMonth],[Master]![birthDay]),DateSerial([Pitching]!
                > > [yearID],7,1))=26;
                > >
                > >
                > > When I run this, I get a "Data type mismatch in
                > the criteria
                > > expression" error. I only get this error when I
                > try to filter out
                > > the performance of a pitcher for a certain age.
                > Simply put, when I
                > > run the calc as is, it runs fine (seemingly).
                > >
                > > I am stumped. By no means am I a DBA, but I am
                > fairly comfortable
                > > with Access and data manipulation.
                > >
                > > Do I have a corrupt version of Access? Has anyone
                > run into the same
                > > problem? Someone have a better way to calculate
                > age at run time?
                > >
                > > Many thanks guys,
                > >
                > > ~ Brock
                > >
                >
                >
                >

                ---------------------------------------------
                http://www.InsideTheBook.com
                The Book--Playing The Percentages In Baseball

                -----------------------------------

                __________________________________________________________
                We won't tell. Get more on shows you hate to love
                (and love to hate): Yahoo! TV's Guilty Pleasures list.
                http://tv.yahoo.com/collections/265




                --
                --
                Sincerely,        
                Sean Forman

                Baseball Stats!   http://www.Baseball-Reference.com/
                SR Blog!           http://www.Baseball-Reference.com/blog/


              • Sean Forman
                Yes, thank you. For some reason, I didn t include parens. This is probably the most clear yearid - (birthyear + (birthmonth 6)) for example if birthyear=1980
                Message 7 of 24 , Mar 8, 2007
                • 0 Attachment
                  Yes, thank you. For some reason, I didn't include parens.

                  This is probably the most clear
                  yearid - (birthyear + (birthmonth > 6))

                  for example if birthyear=1980
                  birthmonth=9
                  yearID=2006

                  age=2006-(1980+1)=25


                  On 3/8/07, John Walsh <walshj58@...> wrote:

                  Shouldn't that be

                  yearid - birthyear - (birthmonth > 6)

                  ?


                  On 3/8/07, Sean Forman < sean-forman@...> wrote:

                  I generally use

                  yearid - birthyear + (birthmonth > 6) 

                  The birthmonth > 6 is computed as a boolean, so it is either 1 or 0 depending on whether it is true or not.  I'm not sure if that works in access or not.

                  sean



                  On 3/7/07, Tangotiger <tangotiger@...> wrote:

                  If all you require is an integer for an age, may I
                  suggest simply doing: yearid - birthyear.

                  Who really cares whether the guy was born Jun 30 or
                  Jul 2, or Dec 30 or Jan 2? Whatever you do, it's a
                  rounded age.

                  Tom



                  --- Charles <chazcreasy1@...> wrote:

                  > I've run into the same problem (a week or so ago
                  > actually). I'm not
                  > sure what I've done different since, but this seems
                  > to work:
                  >
                  > SELECT Master.playerID, Pitching.yearID,
                  > DateDiff("yyyy",DateValue([birthmonth] & '/' &
                  > [birthday] & '/' &
                  > [birthyear]),DateValue("07/01/" &
                  > [Pitching].[yearID])) AS AGE
                  > FROM [primary position] INNER JOIN (Master INNER
                  > JOIN Pitching ON
                  > Master.playerID = Pitching.playerID) ON ([primary
                  > position].yearID =
                  > Pitching.yearID) AND ([primary position].teamID =
                  > Pitching.teamID) AND
                  > ([primary position].player = Pitching.playerID)
                  > WHERE (((DateDiff("yyyy",DateValue([birthmonth] &
                  > '/' & [birthday] &
                  > '/'
                  > & [birthyear]),DateValue("07/01/" &
                  > [Pitching].[yearID])))=26) AND
                  > ((Master.birthYear) Is Not Null) AND
                  > ((Master.birthMonth) Is Not Null)
                  > AND ((Master.birthDay) Is Not Null));
                  >
                  > I'm sure there's a cleaner way to do it, but I'm
                  > pretty certain this
                  > will work. If you do a search and replace for
                  > "pitching"->"batting"
                  > you can get all hitters aged 26.
                  >
                  > --- In baseball-databank@yahoogroups.com, "btibert3"
                  > <btibert3@...> wrote:
                  > >
                  > > I am using the current release of Sean's DB and I
                  > am trying to
                  > > calculate the age for each pitcher with the
                  > following SQL:
                  > >
                  > > SELECT Pitching.playerID, Pitching.yearID,
                  > DateDiff("yyyy",DateSerial
                  > >
                  >
                  ([Master]![birthYear],[Master]![birthMonth],[Master]!
                  > > [birthDay]),DateSerial([Pitching]![yearID],7,1))
                  > AS Age
                  > > FROM Pitching INNER JOIN Master ON
                  > Pitching.playerID =
                  > > Master.playerID
                  > > WHERE
                  >
                  DateDiff("yyyy",DateSerial([Master]![birthYear],[Master]!
                  > >
                  >
                  [birthMonth],[Master]![birthDay]),DateSerial([Pitching]!
                  > > [yearID],7,1))=26;
                  > >
                  > >
                  > > When I run this, I get a "Data type mismatch in
                  > the criteria
                  > > expression" error. I only get this error when I
                  > try to filter out
                  > > the performance of a pitcher for a certain age.
                  > Simply put, when I
                  > > run the calc as is, it runs fine (seemingly).
                  > >
                  > > I am stumped. By no means am I a DBA, but I am
                  > fairly comfortable
                  > > with Access and data manipulation.
                  > >
                  > > Do I have a corrupt version of Access? Has anyone
                  > run into the same
                  > > problem? Someone have a better way to calculate
                  > age at run time?
                  > >
                  > > Many thanks guys,
                  > >
                  > > ~ Brock
                  > >
                  >
                  >
                  >

                  ---------------------------------------------
                  http://www.InsideTheBook.com
                  The Book--Playing The Percentages In Baseball

                  -----------------------------------

                  __________________________________________________________
                  We won't tell. Get more on shows you hate to love
                  (and love to hate): Yahoo! TV's Guilty Pleasures list.
                  http://tv.yahoo.com/collections/265




                  --
                  --
                  Sincerely,        
                  Sean Forman

                  Baseball Stats!  http://www.Baseball-Reference.com/
                  SR Blog!           http://www.Baseball-Reference.com/blog/





                  --
                  --
                  Sincerely,        
                  Sean Forman

                  Baseball Stats!  http://www.Baseball-Reference.com/
                  SR Blog!           http://www.Baseball-Reference.com/blog/
                • Tangotiger
                  I just want to reiterate that, in society, only with ages do we not round. If you are 26.99 years old, you are 26 . If someone is born on July 2, 1980, then
                  Message 8 of 24 , Mar 8, 2007
                  • 0 Attachment
                    I just want to reiterate that, in society, only with
                    ages do we not round.

                    If you are 26.99 years old, you are "26". If someone
                    is born on July 2, 1980, then on July 1 2007, he's 26
                    years and 364 days. Really, we should represent it as
                    26.997.

                    If you have a group of players, you can want guys
                    beween 26.5 and 27.5, so that their average is 27.0
                    years old. And, that means getting everyone born
                    between Jan 1, 1980 and Dec 31, 1980.

                    As you can see, all you need is the year, and
                    therefore, makes the calculation a snap.

                    The current practice was started in the Baseball
                    Abstracts, and shouldn't necessarily be followed.

                    In any case, you can choose any arbitrary date, be it
                    July 1, Apr 1, Oct 1, and it really doesn't matter
                    whatsoever, as long as all players are calculated the
                    same way.

                    Given that, do it the easiest way, and not the
                    complicated way.

                    -- End Soapbox.

                    Tom





                    --- Tangotiger <tangotiger@...> wrote:

                    > If all you require is an integer for an age, may I
                    > suggest simply doing: yearid - birthyear.
                    >
                    > Who really cares whether the guy was born Jun 30 or
                    > Jul 2, or Dec 30 or Jan 2? Whatever you do, it's a
                    > rounded age.
                    >
                    > Tom
                    >
                    >
                    >
                    > --- Charles <chazcreasy1@...> wrote:
                    >
                    > > I've run into the same problem (a week or so ago
                    > > actually). I'm not
                    > > sure what I've done different since, but this
                    > seems
                    > > to work:
                    > >
                    > > SELECT Master.playerID, Pitching.yearID,
                    > > DateDiff("yyyy",DateValue([birthmonth] & '/' &
                    > > [birthday] & '/' &
                    > > [birthyear]),DateValue("07/01/" &
                    > > [Pitching].[yearID])) AS AGE
                    > > FROM [primary position] INNER JOIN (Master INNER
                    > > JOIN Pitching ON
                    > > Master.playerID = Pitching.playerID) ON ([primary
                    > > position].yearID =
                    > > Pitching.yearID) AND ([primary position].teamID =
                    > > Pitching.teamID) AND
                    > > ([primary position].player = Pitching.playerID)
                    > > WHERE (((DateDiff("yyyy",DateValue([birthmonth] &
                    > > '/' & [birthday] &
                    > > '/'
                    > > & [birthyear]),DateValue("07/01/" &
                    > > [Pitching].[yearID])))=26) AND
                    > > ((Master.birthYear) Is Not Null) AND
                    > > ((Master.birthMonth) Is Not Null)
                    > > AND ((Master.birthDay) Is Not Null));
                    > >
                    > > I'm sure there's a cleaner way to do it, but I'm
                    > > pretty certain this
                    > > will work. If you do a search and replace for
                    > > "pitching"->"batting"
                    > > you can get all hitters aged 26.
                    > >
                    > > --- In baseball-databank@yahoogroups.com,
                    > "btibert3"
                    > > <btibert3@...> wrote:
                    > > >
                    > > > I am using the current release of Sean's DB and
                    > I
                    > > am trying to
                    > > > calculate the age for each pitcher with the
                    > > following SQL:
                    > > >
                    > > > SELECT Pitching.playerID, Pitching.yearID,
                    > > DateDiff("yyyy",DateSerial
                    > > >
                    > >
                    >
                    ([Master]![birthYear],[Master]![birthMonth],[Master]!
                    > > > [birthDay]),DateSerial([Pitching]![yearID],7,1))
                    > > AS Age
                    > > > FROM Pitching INNER JOIN Master ON
                    > > Pitching.playerID =
                    > > > Master.playerID
                    > > > WHERE
                    > >
                    >
                    DateDiff("yyyy",DateSerial([Master]![birthYear],[Master]!
                    > > >
                    > >
                    >
                    [birthMonth],[Master]![birthDay]),DateSerial([Pitching]!
                    > > > [yearID],7,1))=26;
                    > > >
                    > > >
                    > > > When I run this, I get a "Data type mismatch in
                    > > the criteria
                    > > > expression" error. I only get this error when I
                    > > try to filter out
                    > > > the performance of a pitcher for a certain age.
                    > > Simply put, when I
                    > > > run the calc as is, it runs fine (seemingly).
                    > > >
                    > > > I am stumped. By no means am I a DBA, but I am
                    > > fairly comfortable
                    > > > with Access and data manipulation.
                    > > >
                    > > > Do I have a corrupt version of Access? Has
                    > anyone
                    > > run into the same
                    > > > problem? Someone have a better way to calculate
                    > > age at run time?
                    > > >
                    > > > Many thanks guys,
                    > > >
                    > > > ~ Brock
                    > > >
                    > >
                    > >
                    > >
                    >
                    >
                    > ---------------------------------------------
                    > http://www.InsideTheBook.com
                    > The Book--Playing The Percentages In Baseball
                    >
                    >
                    >
                    >
                    >
                    >
                    >
                    >
                    >
                    >
                    >
                    > -----------------------------------
                    >
                    >
                    >
                    >
                    ____________________________________________________________________________________
                    > We won't tell. Get more on shows you hate to love
                    > (and love to hate): Yahoo! TV's Guilty Pleasures
                    > list.
                    > http://tv.yahoo.com/collections/265
                    >


                    ---------------------------------------------
                    http://www.InsideTheBook.com
                    The Book--Playing The Percentages In Baseball











                    -----------------------------------



                    ____________________________________________________________________________________
                    Be a PS3 game guru.
                    Get your game face on with the latest PS3 news and previews at Yahoo! Games.
                    http://videogames.yahoo.com/platform?platform=120121
                  • btibert3
                    First, let me thank everyone for taking the time. Charles, your SQL worked perfectly, so thank you very much. Truthfully, it never dawned on me to do something
                    Message 9 of 24 , Mar 8, 2007
                    • 0 Attachment
                      First, let me thank everyone for taking the time.

                      Charles, your SQL worked perfectly, so thank you very much.
                      Truthfully, it never dawned on me to do something simple like Year-
                      Birthyear, but to be honest, the precise Age calculation is something
                      that Access should be able to handle and wanted to figure out what
                      exactly I was doing wrong.

                      Thanks again to everyone who was willing to help,

                      ~ Brock
                    • Sean Forman
                      Tango, There is actually a reasonable reason for using July 1st as the cutoff. When you do that the player s age is given as the age they played most of the
                      Message 10 of 24 , Mar 8, 2007
                      • 0 Attachment
                        Tango,

                        There is actually a reasonable reason for using July 1st as the cutoff.  When you do that the player's age is given as the age they played most of the year as since July 1st is just about the halfway point of the season.  A player who turns 25 on Oct 1 will have played the entire season as a 24-year-old, while a player who turns 25 on Apr 1 wil have played the season as a 25-year-old.  I think it does make some sense.  In effect, this is rounding the player's age to the age they played the season most as.


                        This isn't necessarily related.  There is also some evidence (and I may be misquoting) that players with August and Sept birthdays are more likely to make the majors.  Here is a percentage for players born since 1960.

                        | birth_month | PercBornInMonth |
                        +-------------+-----------------+
                        |           1 | 9.0             |
                        |           2 | 7.1             |
                        |           3 | 8.3             |
                        |           4 | 8.0             |
                        |           5 | 7.7             |
                        |           6 | 7.1             |
                        |           7 | 6.6             |
                        |           8 | 10.9            |
                        |           9 | 8.8             |
                        |          10 | 9.4             |
                        |          11 | 8.9             |
                        |          12 | 8.2             |

                        The speculation is that the July and June kids have to play up with older kids in little league and the Aug, Sept kids are the oldest kids in the leagues and get more attention as they are more physically developed.  Or maybe parents are just lying to keep their kids back a year.

                        On 3/8/07, Tangotiger <tangotiger@...> wrote:

                        I just want to reiterate that, in society, only with
                        ages do we not round.

                        If you are 26.99 years old, you are "26". If someone
                        is born on July 2, 1980, then on July 1 2007, he's 26
                        years and 364 days. Really, we should represent it as
                        26.997.

                        If you have a group of players, you can want guys
                        beween 26.5 and 27.5, so that their average is 27.0
                        years old. And, that means getting everyone born
                        between Jan 1, 1980 and Dec 31, 1980.

                        As you can see, all you need is the year, and
                        therefore, makes the calculation a snap.

                        The current practice was started in the Baseball
                        Abstracts, and shouldn't necessarily be followed.

                        In any case, you can choose any arbitrary date, be it
                        July 1, Apr 1, Oct 1, and it really doesn't matter
                        whatsoever, as long as all players are calculated the
                        same way.

                        Given that, do it the easiest way, and not the
                        complicated way.

                        -- End Soapbox.

                        Tom



                        --- Tangotiger <tangotiger@...> wrote:

                        > If all you require is an integer for an age, may I
                        > suggest simply doing: yearid - birthyear.
                        >
                        > Who really cares whether the guy was born Jun 30 or
                        > Jul 2, or Dec 30 or Jan 2? Whatever you do, it's a
                        > rounded age.
                        >
                        > Tom
                        >
                        >
                        >
                        > --- Charles <chazcreasy1@...> wrote:
                        >
                        > > I've run into the same problem (a week or so ago
                        > > actually). I'm not
                        > > sure what I've done different since, but this
                        > seems
                        > > to work:
                        > >
                        > > SELECT Master.playerID, Pitching.yearID,
                        > > DateDiff("yyyy",DateValue([birthmonth] & '/' &
                        > > [birthday] & '/' &
                        > > [birthyear]),DateValue("07/01/" &
                        > > [Pitching].[yearID])) AS AGE
                        > > FROM [primary position] INNER JOIN (Master INNER
                        > > JOIN Pitching ON
                        > > Master.playerID = Pitching.playerID) ON ([primary
                        > > position].yearID =
                        > > Pitching.yearID) AND ([primary position].teamID =
                        > > Pitching.teamID) AND
                        > > ([primary position].player = Pitching.playerID)
                        > > WHERE (((DateDiff("yyyy",DateValue([birthmonth] &
                        > > '/' & [birthday] &
                        > > '/'
                        > > & [birthyear]),DateValue("07/01/" &
                        > > [Pitching].[yearID])))=26) AND
                        > > ((Master.birthYear) Is Not Null) AND
                        > > ((Master.birthMonth) Is Not Null)
                        > > AND ((Master.birthDay) Is Not Null));
                        > >
                        > > I'm sure there's a cleaner way to do it, but I'm
                        > > pretty certain this
                        > > will work. If you do a search and replace for
                        > > "pitching"->"batting"
                        > > you can get all hitters aged 26.
                        > >
                        > > --- In baseball-databank@yahoogroups.com,
                        > "btibert3"
                        > > <btibert3@...> wrote:
                        > > >
                        > > > I am using the current release of Sean's DB and
                        > I
                        > > am trying to
                        > > > calculate the age for each pitcher with the
                        > > following SQL:
                        > > >
                        > > > SELECT Pitching.playerID, Pitching.yearID,
                        > > DateDiff("yyyy",DateSerial
                        > > >
                        > >
                        >
                        ([Master]![birthYear],[Master]![birthMonth],[Master]!
                        > > > [birthDay]),DateSerial([Pitching]![yearID],7,1))
                        > > AS Age
                        > > > FROM Pitching INNER JOIN Master ON
                        > > Pitching.playerID =
                        > > > Master.playerID
                        > > > WHERE
                        > >
                        >
                        DateDiff("yyyy",DateSerial([Master]![birthYear],[Master]!
                        > > >
                        > >
                        >
                        [birthMonth],[Master]![birthDay]),DateSerial([Pitching]!
                        > > > [yearID],7,1))=26;
                        > > >
                        > > >
                        > > > When I run this, I get a "Data type mismatch in
                        > > the criteria
                        > > > expression" error. I only get this error when I
                        > > try to filter out
                        > > > the performance of a pitcher for a certain age.
                        > > Simply put, when I
                        > > > run the calc as is, it runs fine (seemingly).
                        > > >
                        > > > I am stumped. By no means am I a DBA, but I am
                        > > fairly comfortable
                        > > > with Access and data manipulation.
                        > > >
                        > > > Do I have a corrupt version of Access? Has
                        > anyone
                        > > run into the same
                        > > > problem? Someone have a better way to calculate
                        > > age at run time?
                        > > >
                        > > > Many thanks guys,
                        > > >
                        > > > ~ Brock
                        > > >
                        > >
                        > >
                        > >
                        >
                        >
                        > ---------------------------------------------
                        > http://www.InsideTheBook.com
                        > The Book--Playing The Percentages In Baseball
                        >
                        >
                        >
                        >
                        >
                        >
                        >
                        >
                        >
                        >
                        >
                        > -----------------------------------
                        >
                        >
                        >
                        >
                        __________________________________________________________
                        > We won't tell. Get more on shows you hate to love
                        > (and love to hate): Yahoo! TV's Guilty Pleasures
                        > list.
                        > http://tv.yahoo.com/collections/265
                        >

                        ---------------------------------------------
                        http://www.InsideTheBook.com
                        The Book--Playing The Percentages In Baseball

                        -----------------------------------

                        __________________________________________________________
                        Be a PS3 game guru.
                        Get your game face on with the latest PS3 news and previews at Yahoo! Games.
                        http://videogames.yahoo.com/platform?platform=120121




                        --
                        --
                        Sincerely,        
                        Sean Forman

                        Baseball Stats!  http://www.Baseball-Reference.com/
                        SR Blog!           http://www.Baseball-Reference.com/blog/
                      • Douglas Creager
                        ... Doesn t this assume that the birthrates are even throughout the year? It could just be that more kids are born in August and September. You d probably need
                        Message 11 of 24 , Mar 8, 2007
                        • 0 Attachment
                          > This isn't necessarily related. There is also some evidence (and I may be misquoting) that players with August and Sept birthdays are more likely to make the majors. Here is a percentage for players born since 1960.

                          Doesn't this assume that the birthrates are even throughout the year?
                          It could just be that more kids are born in August and September.
                          You'd probably need to compare those percentages to some census data
                          to make the argument more convincing.

                          cheers
                          --doug

                          --
                          Douglas Creager
                          DPhil Candidate, Computing
                          Oxford University Computing Lab
                          http://www.softeng.ox.ac.uk/people/Douglas.Creager/
                          <douglas.creager@...>
                        • Sean Forman
                          ... . ... I m probably butchering the results of the study, but I think the original study was for hockey and they found a similar effect, but between Dec. and
                          Message 12 of 24 , Mar 8, 2007
                          • 0 Attachment


                            Doesn't this assume that the birthrates are even throughout the year?
                            It could just be that more kids are born in August and September.
                            You'd probably need to compare those percentages to some census data
                            to make the argument more convincing.



                             

                            .

                            I'm probably butchering the results of the study, but I think the original study was for hockey and they found a similar effect, but between Dec. and Jan. which is when the pee wee hockey cutoff occurs.

                            sean




                            --
                            --
                            Sincerely,        
                            Sean Forman

                            Baseball Stats!  http://www.Baseball-Reference.com/
                            SR Blog!           http://www.Baseball-Reference.com/blog/
                          • roca_h@BellSouth.net
                            Sean, do you know of any Minor League database such as Baseball-Reference. Many thanks regards Henri
                            Message 13 of 24 , Mar 8, 2007
                            • 0 Attachment
                              Sean, do you know of any Minor League database such as Baseball-Reference.
                              Many thanks
                              regards
                              Henri
                              >
                              > From: "Sean Forman" <sean-forman@...>
                              > Date: 2007/03/08 Thu AM 10:18:18 EST
                              > To: baseball-databank@yahoogroups.com
                              > Subject: Re: [baseball-databank] Re: Lahman DB and Age Calculation
                              >
                              > >
                              > > Doesn't this assume that the birthrates are even throughout the year?
                              > > It could just be that more kids are born in August and September.
                              > > You'd probably need to compare those percentages to some census data
                              > > to make the argument more convincing.
                              > >
                              >
                              >
                              >
                              >
                              > .
                              > >
                              >
                              > I'm probably butchering the results of the study, but I think the original
                              > study was for hockey and they found a similar effect, but between Dec. and
                              > Jan. which is when the pee wee hockey cutoff occurs.
                              >
                              > sean
                              >
                              >
                              > >
                              >
                              >
                              >
                              > --
                              > --
                              > Sincerely,
                              > Sean Forman
                              >
                              > Baseball Stats! http://www.Baseball-Reference.com/
                              > SR Blog! http://www.Baseball-Reference.com/blog/
                              >
                              >
                            • Theodore Turocy
                              ... There are (currently) no free, generally-available minor league databases. I ve compiled data from 2005 and 2006 (and 1982) at
                              Message 14 of 24 , Mar 8, 2007
                              • 0 Attachment
                                On 3/8/07, roca_h@... <roca_h@...> wrote:

                                Sean, do you know of any Minor League database such as Baseball-Reference.





                                There are (currently) no free, generally-available minor league databases.  I've compiled data from 2005 and 2006 (and 1982) at

                                http://econweb.tamu.edu/turocy/minors

                                and have plans to complete 2002-2004 in the near future, time permitting.

                                TT
                                --
                                drarbiter@... - AMDG
                              • Sean Forman
                                thebaseballcube.com has a lot of recent minor league info. I m hoping to do some work on minor leaguers as well on BR, but it will be awhile. sean ... -- --
                                Message 15 of 24 , Mar 8, 2007
                                • 0 Attachment
                                  thebaseballcube.com has a lot of recent minor league info.  I'm hoping to do some work on minor leaguers as well on BR, but it will be awhile.

                                  sean

                                  On 3/8/07, roca_h@... <roca_h@...> wrote:

                                  Sean, do you know of any Minor League database such as Baseball-Reference.
                                  Many thanks
                                  regards
                                  Henri
                                  >
                                  > From: "Sean Forman" <sean-forman@...>
                                  > Date: 2007/03/08 Thu AM 10:18:18 EST
                                  > To: baseball-databank@yahoogroups.com
                                  > Subject: Re: [baseball-databank] Re: Lahman DB and Age Calculation
                                  >
                                  > >

                                  > > Doesn't this assume that the birthrates are even throughout the year?
                                  > > It could just be that more kids are born in August and September.
                                  > > You'd probably need to compare those percentages to some census data
                                  > > to make the argument more convincing.
                                  > >
                                  >
                                  >
                                  >
                                  >
                                  > .
                                  > >
                                  >
                                  > I'm probably butchering the results of the study, but I think the original
                                  > study was for hockey and they found a similar effect, but between Dec. and
                                  > Jan. which is when the pee wee hockey cutoff occurs.
                                  >
                                  > sean
                                  >
                                  >
                                  > >
                                  >
                                  >
                                  >
                                  > --
                                  > --
                                  > Sincerely,
                                  > Sean Forman
                                  >
                                  > Baseball Stats! http://www.Baseball-Reference.com/
                                  > SR Blog! http://www.Baseball-Reference.com/blog/
                                  >
                                  >




                                  --
                                  --
                                  Sincerely,        
                                  Sean Forman

                                  Baseball Stats!  http://www.Baseball-Reference.com/
                                  SR Blog!           http://www.Baseball-Reference.com/blog/
                                • Tom Stillman
                                  I have to agree with this. How many people do you know that were born at the end of September/beginning of October (conceived during the Holidays) and how
                                  Message 16 of 24 , Mar 8, 2007
                                  • 0 Attachment
                                    I have to agree with this. How many people do you
                                    know that were born at the end of September/beginning
                                    of October (conceived during the Holidays) and how
                                    many do you know born toward the middle of November
                                    (conceived on Valentine's Day)?

                                    Tom Stillman

                                    --- Douglas Creager <dcreager@...> wrote:

                                    > > This isn't necessarily related. There is also
                                    > some evidence (and I may be misquoting) that players
                                    > with August and Sept birthdays are more likely to
                                    > make the majors. Here is a percentage for players
                                    > born since 1960.
                                    >
                                    > Doesn't this assume that the birthrates are even
                                    > throughout the year?
                                    > It could just be that more kids are born in August
                                    > and September.
                                    > You'd probably need to compare those percentages to
                                    > some census data
                                    > to make the argument more convincing.
                                    >
                                    > cheers
                                    > --doug
                                    >
                                    > --
                                    > Douglas Creager
                                    > DPhil Candidate, Computing
                                    > Oxford University Computing Lab
                                    > http://www.softeng.ox.ac.uk/people/Douglas.Creager/
                                    > <douglas.creager@...>
                                    >




                                    ____________________________________________________________________________________
                                    8:00? 8:25? 8:40? Find a flick in no time
                                    with the Yahoo! Search movie showtime shortcut.
                                    http://tools.search.yahoo.com/shortcuts/#news
                                  • Tom Stillman
                                    I agree but would like to add an additional 2 cents. Often we hear about someone being the oldest or youngest to accomplish a certain feat in baseball. In
                                    Message 17 of 24 , Mar 8, 2007
                                    • 0 Attachment
                                      I agree but would like to add an additional 2 cents.
                                      Often we hear about someone being the "oldest" or
                                      "youngest" to accomplish a certain feat in baseball.
                                      In those cases, age is invariably given in years and
                                      days.

                                      Tom Stillman

                                      --- Tangotiger <tangotiger@...> wrote:

                                      > I just want to reiterate that, in society, only with
                                      > ages do we not round.
                                      >
                                      > If you are 26.99 years old, you are "26". If
                                      > someone
                                      > is born on July 2, 1980, then on July 1 2007, he's
                                      > 26
                                      > years and 364 days. Really, we should represent it
                                      > as
                                      > 26.997.
                                      >
                                      > If you have a group of players, you can want guys
                                      > beween 26.5 and 27.5, so that their average is 27.0
                                      > years old. And, that means getting everyone born
                                      > between Jan 1, 1980 and Dec 31, 1980.
                                      >
                                      > As you can see, all you need is the year, and
                                      > therefore, makes the calculation a snap.
                                      >
                                      > The current practice was started in the Baseball
                                      > Abstracts, and shouldn't necessarily be followed.
                                      >
                                      > In any case, you can choose any arbitrary date, be
                                      > it
                                      > July 1, Apr 1, Oct 1, and it really doesn't matter
                                      > whatsoever, as long as all players are calculated
                                      > the
                                      > same way.
                                      >
                                      > Given that, do it the easiest way, and not the
                                      > complicated way.
                                      >
                                      > -- End Soapbox.
                                      >
                                      > Tom
                                      >
                                      >
                                      >
                                      >
                                      >
                                      > --- Tangotiger <tangotiger@...> wrote:
                                      >
                                      > > If all you require is an integer for an age, may I
                                      > > suggest simply doing: yearid - birthyear.
                                      > >
                                      > > Who really cares whether the guy was born Jun 30
                                      > or
                                      > > Jul 2, or Dec 30 or Jan 2? Whatever you do, it's
                                      > a
                                      > > rounded age.
                                      > >
                                      > > Tom
                                      > >
                                      > >
                                      > >
                                      > > --- Charles <chazcreasy1@...> wrote:
                                      > >
                                      > > > I've run into the same problem (a week or so ago
                                      > > > actually). I'm not
                                      > > > sure what I've done different since, but this
                                      > > seems
                                      > > > to work:
                                      > > >
                                      > > > SELECT Master.playerID, Pitching.yearID,
                                      > > > DateDiff("yyyy",DateValue([birthmonth] & '/' &
                                      > > > [birthday] & '/' &
                                      > > > [birthyear]),DateValue("07/01/" &
                                      > > > [Pitching].[yearID])) AS AGE
                                      > > > FROM [primary position] INNER JOIN (Master INNER
                                      > > > JOIN Pitching ON
                                      > > > Master.playerID = Pitching.playerID) ON
                                      > ([primary
                                      > > > position].yearID =
                                      > > > Pitching.yearID) AND ([primary position].teamID
                                      > =
                                      > > > Pitching.teamID) AND
                                      > > > ([primary position].player = Pitching.playerID)
                                      > > > WHERE (((DateDiff("yyyy",DateValue([birthmonth]
                                      > &
                                      > > > '/' & [birthday] &
                                      > > > '/'
                                      > > > & [birthyear]),DateValue("07/01/" &
                                      > > > [Pitching].[yearID])))=26) AND
                                      > > > ((Master.birthYear) Is Not Null) AND
                                      > > > ((Master.birthMonth) Is Not Null)
                                      > > > AND ((Master.birthDay) Is Not Null));
                                      > > >
                                      > > > I'm sure there's a cleaner way to do it, but I'm
                                      > > > pretty certain this
                                      > > > will work. If you do a search and replace for
                                      > > > "pitching"->"batting"
                                      > > > you can get all hitters aged 26.
                                      > > >
                                      > > > --- In baseball-databank@yahoogroups.com,
                                      > > "btibert3"
                                      > > > <btibert3@...> wrote:
                                      > > > >
                                      > > > > I am using the current release of Sean's DB
                                      > and
                                      > > I
                                      > > > am trying to
                                      > > > > calculate the age for each pitcher with the
                                      > > > following SQL:
                                      > > > >
                                      > > > > SELECT Pitching.playerID, Pitching.yearID,
                                      > > > DateDiff("yyyy",DateSerial
                                      > > > >
                                      > > >
                                      > >
                                      >
                                      ([Master]![birthYear],[Master]![birthMonth],[Master]!
                                      > > > >
                                      > [birthDay]),DateSerial([Pitching]![yearID],7,1))
                                      > > > AS Age
                                      > > > > FROM Pitching INNER JOIN Master ON
                                      > > > Pitching.playerID =
                                      > > > > Master.playerID
                                      > > > > WHERE
                                      > > >
                                      > >
                                      >
                                      DateDiff("yyyy",DateSerial([Master]![birthYear],[Master]!
                                      > > > >
                                      > > >
                                      > >
                                      >
                                      [birthMonth],[Master]![birthDay]),DateSerial([Pitching]!
                                      > > > > [yearID],7,1))=26;
                                      > > > >
                                      > > > >
                                      > > > > When I run this, I get a "Data type mismatch
                                      > in
                                      > > > the criteria
                                      > > > > expression" error. I only get this error when
                                      > I
                                      > > > try to filter out
                                      > > > > the performance of a pitcher for a certain
                                      > age.
                                      > > > Simply put, when I
                                      > > > > run the calc as is, it runs fine (seemingly).
                                      >
                                      > > > >
                                      > > > > I am stumped. By no means am I a DBA, but I
                                      > am
                                      > > > fairly comfortable
                                      > > > > with Access and data manipulation.
                                      > > > >
                                      > > > > Do I have a corrupt version of Access? Has
                                      > > anyone
                                      > > > run into the same
                                      > > > > problem? Someone have a better way to
                                      > calculate
                                      > > > age at run time?
                                      > > > >
                                      > > > > Many thanks guys,
                                      > > > >
                                      > > > > ~ Brock
                                      > > > >
                                      > > >
                                      > > >
                                      > > >
                                      > >
                                      > >
                                      > > ---------------------------------------------
                                      > > http://www.InsideTheBook.com
                                      > > The Book--Playing The Percentages In Baseball
                                      > >
                                      > >
                                      > >
                                      > >
                                      > >
                                      > >
                                      > >
                                      > >
                                      > >
                                      > >
                                      > >
                                      > > -----------------------------------
                                      > >
                                      > >
                                      > >
                                      > >
                                      >
                                      ____________________________________________________________________________________
                                      > > We won't tell. Get more on shows you hate to love
                                      > > (and love to hate): Yahoo! TV's Guilty Pleasures
                                      > > list.
                                      > > http://tv.yahoo.com/collections/265
                                      > >
                                      >
                                      >
                                      > ---------------------------------------------
                                      > http://www.InsideTheBook.com
                                      > The Book--Playing The Percentages In Baseball
                                      >
                                      >
                                      >
                                      >
                                      >
                                      >
                                      >
                                      >
                                      >
                                      >
                                      >
                                      >
                                      === message truncated ===




                                      ____________________________________________________________________________________
                                      The fish are biting.
                                      Get more visitors on your site using Yahoo! Search Marketing.
                                      http://searchmarketing.yahoo.com/arp/sponsoredsearch_v2.php
                                    • KJOK
                                      If someone HAS compiled some minor league stats in electronic form, please let me know, as there is a startup project to try to create a minor league database.
                                      Message 18 of 24 , Mar 8, 2007
                                      • 0 Attachment
                                        If someone HAS compiled some minor league stats in electronic form, please let me know, as there is a startup project to try to create a minor league database.
                                         
                                        THANKS,
                                        Kevin

                                        roca_h@... wrote:
                                        Sean, do you know of any Minor League database such as Baseball-Reference.
                                        Many thanks
                                        regards
                                        Henri
                                        >
                                        .



                                        8:00? 8:25? 8:40? Find a flick in no time
                                        with theYahoo! Search movie showtime shortcut.

                                      • Michael Westbay
                                        ... So what you re saying is that this is a cultural issue. I have evidence that this may be correct. +-------+---------+ ... +-------+---------+ ...
                                        Message 19 of 24 , Mar 8, 2007
                                        • 0 Attachment
                                          Sean Forman wrote:

                                          > This isn't necessarily related. There is also some evidence (and I may be
                                          > misquoting) that players with August and Sept birthdays are more likely to
                                          > make the majors. Here is a percentage for players born since 1960.
                                          > ...
                                          > The speculation is that the July and June kids have to play up with older
                                          > kids in little league and the Aug, Sept kids are the oldest kids in the
                                          > leagues and get more attention as they are more physically developed. Or
                                          > maybe parents are just lying to keep their kids back a year.

                                          So what you're saying is that this is a cultural issue. I have evidence
                                          that this may be correct.

                                          +-------+---------+
                                          | Month | Count |
                                          +-------+---------+
                                          | 1 | 6.1284 |
                                          | 2 | 4.4261 |
                                          | 3 | 5.3502 |
                                          | 4 | 11.1868 |
                                          | 5 | 11.3813 |
                                          | 6 | 10.7490 |
                                          | 7 | 10.4572 |
                                          | 8 | 10.0195 |
                                          | 9 | 8.2685 |
                                          | 10 | 8.5117 |
                                          | 11 | 6.3716 |
                                          | 12 | 7.1498 |
                                          +-------+---------+

                                          The above is the percentage of 2056 players in NPB (Nippon Professional
                                          Baseball) born in or after 1960. Here the peak is in April and May and
                                          steadily goes down from there. The school year in Japan starts in
                                          April, so April and May born kids will tend to be the most physically
                                          developed in their school years.

                                          (Note: I did not filter out foreign players, but August/September borns
                                          don't seem to effect the distribution any.)

                                          This is an interesting study.


                                          --
                                          Michael Westbay
                                          Writer/System Administrator
                                          http://JapaneseBaseball.com
                                        • Tangotiger
                                          -- Sean Forman ... I understand the reason. But if I have 20 players all born between Jan 1, 1980 and Dec 31, 1980, their
                                          Message 20 of 24 , Mar 8, 2007
                                          • 0 Attachment
                                            -- Sean Forman <sean-forman@...>
                                            wrote:

                                            > Tango,
                                            >
                                            > There is actually a reasonable reason for using July
                                            > 1st as the cutoff.
                                            > When you do that the player's age is given as the
                                            > age they played most of
                                            > the year as since July 1st is just about the halfway
                                            > point of the season. A
                                            >

                                            I understand the reason. But if I have 20 players all
                                            born between Jan 1, 1980 and Dec 31, 1980, their age,
                                            as of July 1, 2007, will be between 26.5 and 27.5.
                                            Their average age is therefore 27.0.

                                            However, if you use the July 1, 2007 Bill James method
                                            as the cutoff, the players aged "27" will be born
                                            between July 2, 1979 and July 1, 1980. Those guys are
                                            aged 27.00 to 27.99, for an average age of 27.5.

                                            Therefore, if you were to list a group of 20 players
                                            aged "27" using the Bill James method, they in fact
                                            are aged, as a group 27.5 years old.

                                            Except for "age", there is no other number that
                                            society would floor. All other conventional numbers
                                            are rounded.

                                            If there were no such thing as a word called "age",
                                            season minus birth year is perfectly acceptable. It
                                            is simply because we treat an age of 27.99 as "27" are
                                            we having even having this discussion.

                                            Tom




                                            ---------------------------------------------
                                            http://www.InsideTheBook.com
                                            The Book--Playing The Percentages In Baseball











                                            -----------------------------------



                                            ____________________________________________________________________________________
                                            It's here! Your new message!
                                            Get new email alerts with the free Yahoo! Toolbar.
                                            http://tools.search.yahoo.com/toolbar/features/mail/
                                          • Michael Westbay
                                            I ve also run this query through my Taiwanese database (combined CPBL and TML players). Out of 1,700 players, these are the results: Month Count 1 8.6%
                                            Message 21 of 24 , Mar 8, 2007
                                            • 0 Attachment
                                              I've also run this query through my Taiwanese database (combined CPBL
                                              and TML players). Out of 1,700 players, these are the results:

                                              Month Count
                                              1 8.6%
                                              2 7.4%
                                              3 7.6%
                                              4 6.8%
                                              5 7.0%
                                              6 5.7%
                                              7 5.4%
                                              8 8.8%
                                              9 10.1%
                                              10 11.6%
                                              11 12.0%
                                              12 9.1%

                                              If I had to make a guess, I'd say that the school year starts around the
                                              end of August, beginning of September in Taiwan, making those born in
                                              the August to November range the biggest in their classes. Notice how
                                              the numbers drop steadily starting in December?

                                              Wow. This is interesting.

                                              --
                                              Michael Westbay
                                              Writer/System Administrator
                                              http://JapaneseBaseball.com
                                            • Tangotiger
                                              ... There was a thread about this on a Freakanomics blog entry. If you are going to calculate age as a single integer, it needs to be done by looking at where
                                              Message 22 of 24 , Mar 8, 2007
                                              • 0 Attachment
                                                --- Michael Westbay
                                                <westbaystars@...> wrote:

                                                >
                                                > Wow. This is interesting.
                                                >


                                                There was a thread about this on a Freakanomics blog
                                                entry.

                                                If you are going to calculate age as a single integer,
                                                it needs to be done by looking at where the players
                                                are clustered, whether by when they are born, when
                                                they are drafted, or when they enter school.

                                                "Mid-point of season, and flooring the age" is
                                                meaningless. If you choose a meaningless arbitrary
                                                point, make the calculation the easiest.

                                                Tom


                                                ---------------------------------------------
                                                http://www.InsideTheBook.com
                                                The Book--Playing The Percentages In Baseball











                                                -----------------------------------



                                                ____________________________________________________________________________________
                                                8:00? 8:25? 8:40? Find a flick in no time
                                                with the Yahoo! Search movie showtime shortcut.
                                                http://tools.search.yahoo.com/shortcuts/#news
                                              • Tangotiger
                                                Here s one such article: http://www.nytimes.com/2006/05/07/magazine/07wwln_freak.html?ei=5070&en=1ff54422d3371507&ex=1173502800&pagewanted=all Tom ...
                                                Message 23 of 24 , Mar 8, 2007
                                                • 0 Attachment
                                                  Here's one such article:
                                                  http://www.nytimes.com/2006/05/07/magazine/07wwln_freak.html?ei=5070&en=1ff54422d3371507&ex=1173502800&pagewanted=all

                                                  Tom

                                                  ---------------------------------------------
                                                  http://www.InsideTheBook.com
                                                  The Book--Playing The Percentages In Baseball











                                                  -----------------------------------



                                                  ____________________________________________________________________________________
                                                  Never miss an email again!
                                                  Yahoo! Toolbar alerts you the instant new Mail arrives.
                                                  http://tools.search.yahoo.com/toolbar/features/mail/
                                                Your message has been successfully submitted and would be delivered to recipients shortly.