Article View: borland.public.interbase.sql
Article #692Re: Contact Age Query
From: Jason Summers
Date: Sat, 03 Nov 2007 00:30
Date: Sat, 03 Nov 2007 00:30
29 lines
2206 bytes
2206 bytes
*Puts on dunce cap*
Yeah, you're right. If I wanted all contacts age 47+, I could:
select CONTACTID from CONTACTS where CBIRTHDAY < '11/02/1960'
select CONTACTID from CONTACTS where CBIRTHDAY < ('Now' - ([Age X] * 365))
(Precalculate the date and put it in query string).
I should've thought of that, but that's why I ask the experts :) Problem
solved. Thanks everyone.
- Jason
"Wayne Niddery (TeamB)" <wniddery@chaffaci.on.ca> wrote in message
news:472bbdbe$1@newsgroups.borland.com...
> "Jason Summers" <jason@grinc.org> wrote in message
> news:472bb775@newsgroups.borland.com...
>> Thanks for the information Bill. That's too bad :( I guess this query
>> will have to remain unoptimized for now.
>
> Why? Just change your query. Bill gave you a start.
>
>>> SELECT CONTACTID FROM CONSTACTS
>>> WHERE CBIRTHDAY < ...
>
> Use a parameter and pass an appropriate date.
>
> --
> Wayne Niddery - Winwright, Inc. (www.winwright.ca)
Technical Details
Message-ID:
<472bc141$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!eweka.nl!lightspeed.eweka.nl!195.114.231.69.MISMATCH!feeder.news-service.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<472a8b02$1@newsgroups.borland.com> <472a977d$1@newsgroups.borland.com> <472bb775@newsgroups.borland.com> <472bbdbe$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 114a0e,32d2d968e29f0f52 X-Google-Attributes: gid114a0e,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Reply-To: "Jason Summers" <jason@grinc.org> From: "Jason Summers" <jason@grinc.org> Newsgroups: borland.public.interbase.sql References: <472a8b02$1@newsgroups.borland.com> <472a977d$1@newsgroups.borland.com> <472bb775@newsgroups.borland.com> <472bbdbe$1@newsgroups.borland.com> In-Reply-To: <472bbdbe$1@newsgroups.borland.com> Subject: Re: Contact Age Query Date: Fri, 2 Nov 2007 19:30:30 -0500 Lines: 30 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Windows Mail 6.0.6000.16480 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6000.16545 NNTP-Posting-Host: 64.251.145.50 Message-ID: <472bc141$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1194049857 64.251.145.50 (2 Nov 2007 17:30:57 -0700) Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!eweka.nl!lightspeed.eweka.nl!195.114.231.69.MISMATCH!feeder.news-service.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail