🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.interbase.sql
Article #674

Re: Birthdate Query

#674
From: Robin
Date: Tue, 30 Oct 2007 04:03
29 lines
1519 bytes
Jason Summers wrote:
> I have an Interbase database which stores Contacts, and one of the 
> fields is the Birthdate, of type TIMESTAMP.  I need to be able to query 
> all Contacts with birthdates in a particular season (Spring, Fall, 
> Winter, Summer)

Hi Jason,

You can use EXTRACT.

Eg,

SELECT
EXTRACT(month FROM mydatefield),
EXTRACT(day FROM mydatefield)

FROM
mytable

etc...


Follow this link to see some working examples:

http://www.interbase-world.com/en/articles/505.php

Good luck!

Robin.
Technical Details
Message-ID: <4726acbf$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!feeder3.cambrium.nl!feeder2.cambrium.nl!feed.tweaknews.nl!193.201.147.84.MISMATCH!xlned.com!feeder1.xlned.com!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4726a766@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 114a0e,d9969aee39c0cba7
X-Google-Attributes: gid114a0e,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Tue, 30 Oct 2007 15:03:06 +1100
From: Robin <Robin@.com>
User-Agent: Thunderbird 1.5.0.12 (Windows/20070509)
MIME-Version: 1.0
Newsgroups: borland.public.interbase.sql
Subject: Re: Birthdate Query
References: <4726a766@newsgroups.borland.com>
In-Reply-To: <4726a766@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 165.228.6.111
Message-ID: <4726acbf$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1193716927 165.228.6.111 (29 Oct 2007 21:02:07 -0700)
Lines: 29
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!feeder3.cambrium.nl!feeder2.cambrium.nl!feed.tweaknews.nl!193.201.147.84.MISMATCH!xlned.com!feeder1.xlned.com!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail