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

RE: [SQLQueriesNoCode] How to find age??

Expand Messages
  • Rob
    Examples are here as well as an explanation - http://msdn.microsoft.com/en-us/library/ms189794.aspx _____ From: SQLQueriesNoCode@yahoogroups.com
    Message 1 of 7 , Sep 3, 2008
    • 0 Attachment
      Examples are here as well as an explanation -
      http://msdn.microsoft.com/en-us/library/ms189794.aspx





      _____

      From: SQLQueriesNoCode@yahoogroups.com
      [mailto:SQLQueriesNoCode@yahoogroups.com] On Behalf Of aks_0910
      Sent: Wednesday, September 03, 2008 1:12 AM
      To: SQLQueriesNoCode@yahoogroups.com
      Subject: [SQLQueriesNoCode] How to find age??



      Hi...

      Can anyone tell me how to find age between two dates?
      soppose 1st date is 02-apr-90 and 2nd date is sysdate...then how to
      find age between sysdate and 02-apr-90???

      Plz help with code



      No virus found in this incoming message.
      Checked by AVG - http://www.avg.com
      Version: 8.0.169 / Virus Database: 270.6.15/1648 - Release Date: 9/2/2008
      5:29 PM




      [Non-text portions of this message have been removed]
    • vigoudhaya
      it s also one way to find age select datepart(year,getdate())-(1984) as years,datepart(mm,getdate ())-(04) as months,datepart(dd,getdate())-(02) as days u
      Message 2 of 7 , Sep 3, 2008
      • 0 Attachment
        it's also one way to find age
        select datepart(year,getdate())-(1984) as years,datepart(mm,getdate
        ())-(04) as months,datepart(dd,getdate())-(02) as days

        u execute this query as much u get correct answer












        --- In SQLQueriesNoCode@yahoogroups.com, "John Warner" <john@...>
        wrote:
        >
        > Fall term at all the colleges 'round herah. This looks like a SQL
        Server
        > II early in the term question. First quiz is coming up.
        >
        > John Warner
        >
        >
        > > -----Original Message-----
        > > From: SQLQueriesNoCode@yahoogroups.com
        > > [mailto:SQLQueriesNoCode@yahoogroups.com] On Behalf Of Arnie
        Rowland
        > > Sent: Wednesday, September 03, 2008 1:31 PM
        > > To: SQLQueriesNoCode@yahoogroups.com
        > > Subject: RE: [SQLQueriesNoCode] How to find age??
        > >
        > > Or even DATEDIFF()...
        > >
        > > ;)
        > >
        > > Yes, it is about the end of summer term...
        > >
        > > But really, didn't you learn in college that 'only when
        everything else
        > fails, look
        > > in the documentation..."
        > >
        > > Regards,
        > >
        > > Arnie Rowland, MVP (SQL Server)
        > >
        > > "I am a great believer in luck, and I find that the harder I
        work, the
        > more I have
        > > of it."
        > > - Thomas Jefferson (1743-1826)
        > >
        > >
        > > -----Original Message-----
        > > From: SQLQueriesNoCode@yahoogroups.com
        > > [mailto:SQLQueriesNoCode@yahoogroups.com] On Behalf Of Stephen
        > > Russell
        > > Sent: Wednesday, September 03, 2008 10:24 AM
        > > To: Arnie
        > > Subject: Re: [SQLQueriesNoCode] How to find age??
        > >
        > > Looks like homework time again.
        > >
        > > Look up datedif()
        > >
        > > _________________________________
        > >
        > > aks_0910 wrote:
        > > >
        > > > Hi...
        > > >
        > > > Can anyone tell me how to find age between two dates?
        > > > soppose 1st date is 02-apr-90 and 2nd date is sysdate...then
        how to
        > > > find age between sysdate and 02-apr-90???
        > > >
        > > > Plz help with code
        > > >
        > >
        > > >
        > > >
        > --------------------------------------------------------------------
        ----
        > > >
        > > >
        > > > No virus found in this incoming message.
        > > > Checked by AVG - http://www.avg.com
        > > > Version: 8.0.169 / Virus Database: 270.6.14/1645 - Release Date:
        > 9/1/2008
        > > 7:19 AM
        > > >
        > > >
        > >
        > >
        > >
        > > ------------------------------------
        > >
        > > Yahoo! Groups Links
        > >
        > >
        > >
        > >
        > >
        > >
        > >
        > > Disclaimer - September 3, 2008
        > > This email and any files transmitted with it are confidential and
        > intended solely
        > > for SQLQueriesNoCode@yahoogroups.com If you are not the named
        > > addressee you should not disseminate, distribute, copy or alter
        this
        > email. Any
        > > views or opinions presented in this email are solely those of the
        author
        > and
        > > might not represent those of Westwood Consulting, Inc. Warning:
        Although
        > > Westwood Consulting, Inc has taken reasonable precautions to
        ensure no
        > > viruses are present in this email, the company cannot accept
        > responsibility for
        > > any loss or damage arising from the use of this email or
        attachments.
        > > This disclaimer was added by Policy Patrol:
        http://www.policypatrol.com/
        > >
        > > ------------------------------------
        > >
        > > Yahoo! Groups Links
        > >
        > >
        > >
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.