pattern matching with dates?

From: "Good, Thomas" <tgood(at)svcmcny(dot)org>
To: "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: pattern matching with dates?
Date: 2011-01-05 19:39:10
Message-ID: FA041D403EDFCD4397E1F6382360ECFCFDB5697143@SVCMCEMAIL.svcmc.svcmcny.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

This dubious query worked well previously:
select * from db_log where log_date LIKE '2011-01-%';
(currently works on bluehost.com where they run 8.1.22)

Can someone offer a (preferably ANSI compliant) way to do this on 8.4.5?

I realize that >= and so on work well (which may explain why the docs
are pretty silent about pattern matching with dates) but sometimes it's nice to
treat the (ISO) date as a string.

thanks much,
Tom
--
Thomas Good, Senior Database Administrator
Saint Vincent's Hospital Westchester
A Division of Saint Joseph's Medical Center
Residential Services
75 Vanderbilt Avenue, Room 5-47
Staten Island, NY 10304
718.818.5528

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Jasen Betts 2011-01-05 19:54:47 Re: foreign key question
Previous Message Tarsis Lima 2011-01-05 14:18:26 return records with more than one occurrences