Re: [sqlite] calculate age (off topic)

2007-01-04 Thread Dennis Jenkins
Jay Sprenkle wrote: > LOL! You should look at a function to determine if a day is a holiday. > Talk about ugly! In some places you literally need to know the weather > and the phase of the moon! > > -- [EMAIL PROTECTED] ~/movie]$ pom The Moon is Waning Gibbous (100% of Full) [EMAIL PROTECTED]

Re: [sqlite] calculate age

2007-01-03 Thread Jay Sprenkle
> LOL! You should look at a function to determine if a day is a holiday. > Talk about ugly! In some places you literally need to know the weather > and the phase of the moon! > > -- [EMAIL PROTECTED] ~/movie]$ pom The Moon is Waning Gibbous (100% of Full) [EMAIL PROTECTED] ~/movie]$ which pom

Re: [sqlite] calculate age

2007-01-02 Thread Dennis Jenkins
Jay Sprenkle wrote: LOL! You should look at a function to determine if a day is a holiday. Talk about ugly! In some places you literally need to know the weather and the phase of the moon! -- [EMAIL PROTECTED] ~/movie]$ pom The Moon is Waning Gibbous (100% of Full) [EMAIL PROTECTED]

Re: [sqlite] calculate age

2006-12-23 Thread Clark Christensen
I see Microsoft is already offering a patch for Windows XP to handle the new U.S. DST rules. -Clark - Original Message From: Joe Wilson <[EMAIL PROTECTED]> To: sqlite-users@sqlite.org Sent: Saturday, December 23, 2006 9:52:02 AM Subject: Re: [sqlite] calculate age H

RE: [sqlite] calculate age

2006-12-23 Thread Fred Williams
gt; Subject: Re: [sqlite] calculate age > > > Holiday determination per country (or even per state/city) > via an algorithm > can only get you so far because it is at the whim of > constantly changing > local laws. You basically need a database of all the dates > for the excep

Re: [sqlite] calculate age

2006-12-23 Thread Joe Wilson
Holiday determination per country (or even per state/city) via an algorithm can only get you so far because it is at the whim of constantly changing local laws. You basically need a database of all the dates for the exceptions. Even getting a reliable source of such information for various

Re: [sqlite] calculate age

2006-12-23 Thread Jay Sprenkle
On 12/23/06, Joe Wilson <[EMAIL PROTECTED]> wrote: Warning - Thar Be Dragons Here! The definition of a month is more or less arbitrary depending on the situation. Trying to define what exactly is the duration of a "month" is a bottomless pit of endless bickering best decided by druids, popes

Re: [sqlite] calculate age

2006-12-23 Thread Joe Wilson
Warning - Thar Be Dragons Here! The definition of a month is more or less arbitrary depending on the situation. Trying to define what exactly is the duration of a "month" is a bottomless pit of endless bickering best decided by druids, popes and historians - certainly beyond the scope of

RE: [sqlite] calculate age

2006-12-22 Thread RB Smissaert
Can confirm now that mine didn't work and yours does. Nice work! RBS -Original Message- From: Dennis Cote [mailto:[EMAIL PROTECTED] Sent: 22 December 2006 19:17 To: sqlite-users@sqlite.org Subject: Re: [sqlite] calculate age RB Smissaert wrote: > I think I got it now: > &g

RE: [sqlite] calculate age

2006-12-22 Thread RB Smissaert
: [sqlite] calculate age "RB Smissaert" <[EMAIL PROTECTED]> wrote: > Is there a way to calculate the age given the 2 dates in the standard format > -mm-dd? I could do julianday('now') - julianday(dateofbirth) and divide > by 365, but that won't be accurate e

RE: [sqlite] calculate age

2006-12-22 Thread RB Smissaert
Re: [sqlite] calculate age RB Smissaert wrote: > I think I got it now: > > select > (date('now') - '2002-12-22') - > ((julianday('now', '-' || > (date('now') - '2002-12-22') || > 'year') < > julianday('2002-12-22'))) > > seems to

Re: [sqlite] calculate age

2006-12-22 Thread drh
"RB Smissaert" <[EMAIL PROTECTED]> wrote: > Is there a way to calculate the age given the 2 dates in the standard format > -mm-dd? I could do julianday('now') - julianday(dateofbirth) and divide > by 365, but that won't be accurate enough. > It would be easy to calculate the age in the

RE: [sqlite] calculate age

2006-12-22 Thread RB Smissaert
Yes, thanks that works. Will do a bit of testing to see which one is the fastest. RBS -Original Message- From: Dennis Cote [mailto:[EMAIL PROTECTED] Sent: 22 December 2006 19:05 To: sqlite-users@sqlite.org Subject: Re: [sqlite] calculate age RB Smissaert wrote: > Tha

Re: [sqlite] calculate age

2006-12-22 Thread Dennis Cote
RB Smissaert wrote: I think I got it now: select (date('now') - '2002-12-22') - ((julianday('now', '-' || (date('now') - '2002-12-22') || 'year') < julianday('2002-12-22'))) seems to work. This is either clever or foolhardy depending upon how you

Re: [sqlite] calculate age

2006-12-22 Thread Dennis Cote
RB Smissaert wrote: Thanks, it is getting close, but it doesn't quite work. For example this: select case when date('2002-12-22', '+' || strftime('%Y', 'now') - strftime('%Y', '2002-12-22') || ' years') >= date('now') then strftime('%Y', 'now') -

RE: [sqlite] calculate age

2006-12-22 Thread RB Smissaert
ent: 22 December 2006 18:12 To: sqlite-users@sqlite.org Subject: Re: [sqlite] calculate age RB Smissaert wrote: > Is there a way to calculate the age given the 2 dates in the standard format > -mm-dd? I could do julianday('now') - julianday(dateofbirth) and divide > by 365, but that won't

RE: [sqlite] calculate age

2006-12-22 Thread RB Smissaert
Re: [sqlite] calculate age RB Smissaert wrote: > Is there a way to calculate the age given the 2 dates in the standard format > -mm-dd? I could do julianday('now') - julianday(dateofbirth) and divide > by 365, but that won't be accurate enough. > It would be easy to ca

RE: [sqlite] calculate age

2006-12-22 Thread RB Smissaert
This 'hard-coded' SQL does the job: select (date('now') - '2002-12-23') - ((julianday('now', '-4year') < julianday('2002-12-23'))) But the trouble is to get the value 4 here. This value should be date('now') - '2002-12-23' But I can't get the right syntax to achieve that. RBS -Original

Re: [sqlite] calculate age

2006-12-22 Thread Dennis Cote
RB Smissaert wrote: Is there a way to calculate the age given the 2 dates in the standard format -mm-dd? I could do julianday('now') - julianday(dateofbirth) and divide by 365, but that won't be accurate enough. It would be easy to calculate the age in the application and update the