On Mon, Oct 27, 2003 at 05:32:34PM -0500, sean peters wrote:
> Hi all, 
> I have run into a date storage problem that i don't like. A am storing 
> historic house sales, and some of the old data i have received only contains 
> the month and year, but not the date of the sale. Of course we want to store 
> this information, but a DATE column won't quite do the job, because year, 
> month, and day are all required.
> 
> So, my homecooked solution is to use a DATE column, and another column as a 
> flag to denote whether the day-of-month is valid. Then i'll need to properly 
> craft my searches to understand this.

Why not just set the day value to '00' if you don't have a value, and 
then check that in your client code? That way, no extra columns. I.e. if
you don't have a day value, then your DATE will be
$sale-date-year . "-" . $sale-date-month . "-00", or whatever.

Jesse Sheidlower



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to