RE: [sqlite] Age calculation on literal

2007-06-03 Thread RB Smissaert
quot; & _ "((" & strCY & " - strftime('%Y', " & strField & ")) * 12 + " & _ "(" & strCM & " - strftime('%m', " & strField & "))) - 0 " & _ "end " &

RE: [sqlite] Age calculation on literal

2007-06-01 Thread RB Smissaert
calculation on literal Got this now, after correcting the brackets: SELECT case when date('2006-10-14', '+' || (strftime('%Y', 'now') - strftime('%Y', '2006- 10-14')) || ' years') <= date('now') then ca

RE: [sqlite] Age calculation on literal

2007-06-01 Thread RB Smissaert
;%d', 'now') > strftime('%d', '2006-10-14') then (strftime('%Y', 'now') - strftime('%Y', '2006-10-14') - 1) * 12 + (strftime('%m', 'now') + (12 - strftime('%m', '2006-1

RE: [sqlite] Age calculation on literal

2007-06-01 Thread RB Smissaert
Yes, that looks better and thanks for that. Still get the same error though. I will keep fiddling with it. RBS -Original Message- From: Dennis Cote [mailto:[EMAIL PROTECTED] Sent: 01 June 2007 19:53 To: sqlite-users@sqlite.org Subject: Re: [sqlite] Age calculation on literal On 6/1/07

Re: [sqlite] Age calculation on literal

2007-06-01 Thread Dennis Cote
On 6/1/07, RB Smissaert <[EMAIL PROTECTED]> wrote: Got this nearly worked out now, but somehow I can't get the nested case when syntax right: SELECT case when date('2006-10-14', '+' || (strftime('%Y', 'now') - strftime('%Y', '2006-10-14')) || ' years') <= date('now') then case when strftime('%d

RE: [sqlite] Age calculation on literal

2007-06-01 Thread RB Smissaert
#x27;) > strftime('%d', '2006-10-14') then ((strftime('%Y', 'now') - strftime('%Y', '2006-10-14') -1) * 12 + (strftime('%m', 'now') + (12 - strftime('%m', '2006-10-14' -1 else (strfti

RE: [sqlite] Age calculation on literal

2007-05-31 Thread RB Smissaert
kind of things ... RBS -Original Message- From: Dennis Cote [mailto:[EMAIL PROTECTED] Sent: 31 May 2007 22:17 To: sqlite-users@sqlite.org Subject: Re: [sqlite] Age calculation on literal RB Smissaert wrote: > Thanks to Dennis Cote I got a nice way to get the age from the date in

RE: [sqlite] Age calculation on literal

2007-05-31 Thread RB Smissaert
DOB Age in months -- 2007-05-01 0 2007-04-30 1 2007-01-01 4 Etc. RBS -Original Message- From: Dennis Cote [mailto:[EMAIL PROTECTED] Sent: 31 May 2007 22:17 To: sqlite-users@sqlite.org Subject: Re: [sqlite] Age calculation on literal RB Smissaert

Re: [sqlite] Age calculation on literal

2007-05-31 Thread Dennis Cote
RB Smissaert wrote: Thanks to Dennis Cote I got a nice way to get the age from the date in the form '-nmm-dd'. It works fine when I run it on a field, but when I run it on a literal date it gives me 100 too much: select case when date('2002-01-01', '+' || (strftime('%Y', 'now') - strftime(