RE: [sqlite] Age calculation on literal

2007-06-03 Thread RB Smissaert
_ "(" & strCM & " - strftime('%m', " & strField & "))) - 0 " & _ "end " & _ "else " & _ "case when " & strCD & " < strftime('%d', " & strField & ") then " &

RE: [sqlite] Age calculation on literal

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

RE: [sqlite] Age calculation on literal

2007-06-01 Thread RB Smissaert
- 1) * 12 + (strftime('%m', 'now') + (12 - strftime('%m', '2006-10-14'))) end end 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, RB Smissaert <[EMA

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

RE: [sqlite] Age calculation on literal

2007-06-01 Thread RB Smissaert
006-10-14'))) end end It will give me an error (from my VB wrapper) syntax error near else. Any idea what is wrong here? 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 li

RE: [sqlite] Age calculation on literal

2007-05-31 Thread RB Smissaert
ind 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 the

RE: [sqlite] Age calculation on literal

2007-05-31 Thread RB Smissaert
then 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') -