List:General Discussion« Previous MessageNext Message »
From:Mike Blezien Date:June 25 2007 8:53pm
Subject:Re: Birthday format
View as plain text  
----- Original Message ----- 
From: "Mike Aubury" <mike.aubury@stripped>
To: <mysql@stripped>; "Mike Blezien" <mickalo@stripped>
Cc: "Jerry Schwartz" <jschwartz@stripped>
Sent: Monday, June 25, 2007 3:44 PM
Subject: Re: Birthday format


>I might be wrong - but isn't that going to mess up on or around the birthday 
> because of leap years ? 
> 
> I know its more complex - but something like : 
> 
> 
> select year(curdate())-year("1952-06-24")-
>         (dayofyear(curdate())<dayofyear("1952-06-24")) age;
> 
> 
> might work better...

Kwel ... this works just as well.

Thx's
Mike

> On Monday 25 June 2007 21:07, Mike Blezien wrote:
>> thanks, worked prefectly,
>>
>> Mike
>> ----- Original Message -----
>> From: "Jerry Schwartz" <jschwartz@stripped>
>> To: "'Mike Blezien'" <mickalo@stripped>; "'MySQL List'"
>> <mysql@stripped>
>> Sent: Monday, June 25, 2007 3:01 PM
>> Subject: RE: Birthday format
>>
>> > mysql> SELECT FLOOR(54.75);
>> > +--------------+
>> >
>> > | FLOOR(54.75) |
>> >
>> > +--------------+
>> >
>> > |           54 |
>> >
>> > +--------------+
>> > 1 row in set (0.05 sec)
>> >
>> > Regards,
>> >
>> > Jerry Schwartz
>> > The Infoshop by Global Information Incorporated
>> > 195 Farmington Ave.
>> > Farmington, CT 06032
>> >
>> > 860.674.8796 / FAX: 860.674.8341
>> >
>> > www.the-infoshop.com
>> > www.giiexpress.com
>> > www.etudes-marche.com
>> >
>> >> -----Original Message-----
>> >> From: Mike Blezien [mailto:mickalo@stripped]
>> >> Sent: Monday, June 25, 2007 2:48 PM
>> >> To: MySQL List
>> >> Subject: Birthday format
>> >>
>> >> Hello,
>> >>
>> >> we have a simple query to calculate someones birthday:
>> >>
>> >> SELECT (TO_DAYS(CURDATE()) - TO_DAYS('1952-10-06')) / 365;
>> >>
>> >> = 54.75
>> >>
>> >>
>> >> Now is there away, using SQL, to remove the .75 without
>> >> rounding off. we just
>> >> want the '54' value. We can do it easy enough with our Perl
>> >> programming, but was
>> >> wondering if this can be accomplished within the actual query itself.
>> >>
>> >> TIA,
>> >>
>> >> Mike(mickalo)Blezien
>> >> ===============================
>> >> Thunder Rain Internet Publishing
>> >> Providing Internet Solution that Work
>> >> http://www.thunder-rain.com
>> >> ===============================
>> >>
>> >> --
>> >> MySQL General Mailing List
>> >> For list archives: http://lists.mysql.com/mysql
>> >> To unsubscribe:
>> >> http://lists.mysql.com/mysql?unsub=1
> 
> -- 
> Mike Aubury
> 
> Aubit Computing Ltd is registered in England and Wales, Number: 3112827
> Registered Address : Murlain Business Centre, Union Street, Chester, CH1 1QP
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/mysql?unsub=1
>
Thread
Birthday formatMike Blezien25 Jun
  • Re: Birthday formatChris Boget25 Jun
  • Re: Birthday formatMike Blezien25 Jun
  • RE: Birthday formatJerry Schwartz25 Jun
  • Re: Birthday formatMike Blezien25 Jun
    • Re: Birthday formatMike Aubury25 Jun
  • Re: Birthday formatMike Blezien25 Jun