Date searching by month & day only - Mailing list pgsql-novice

From Chris Campbell
Subject Date searching by month & day only
Date
Msg-id 453A24085F801842AEA8D0B6B269065D020B2D9099FC@HDMC.cds.local
Whole thread Raw
Responses Re: Date searching by month & day only  (Steve Crawford <scrawford@pinpointresearch.com>)
List pgsql-novice

Hello List,

 

I’m attempting to pull up a birthday list of anyone born between, let’s say June 15 and June 30th.  The year is irrelevant.  

 

I’m wondering if there is a more elegant way to do this than using something like:

 

SELECT key, dob from ds1.contact

WHERE

extract(month FROM contact.dob ) = 6

and extract(day FROM contact.dob) >= 15

and extract(day FROM contact.dob) <= 30

 

Thanks for any suggestions…

 

Regards,

 

Chris Campbell

Cascasde Data Solutions Inc.

800.280.2090

ccampbell@cascadeds.com

 

pgsql-novice by date:

Previous
From: Andrej
Date:
Subject: Re: Updating RHEL4 system for PHP; requires Postgresql updates
Next
From: Steve Crawford
Date:
Subject: Re: Date searching by month & day only