From: Christian Mack Date: March 25 1999 1:19pm Subject: Re: Date query help? List-Archive: http://lists.mysql.com/mysql/948 Message-Id: <36FA37F8.43403D71@compal.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Jesse Brown wrote: > > Hello Folks. I am looking for a way to do this in a single query, and I > was not able to find much enlightenment in the docs, and I was hoping > someone on the list could help.. > > I would like to get the number of entries with START_TIME's (in DATETIME > format) before the specified date that have END_TIME's (in DATETIME format > as well) after the specified date. Currently the only way I can think of > doing it is to fetch each date, convert each to UNIX_TIME, and then do the > compares. However because subselect's are not implemented yet, this means > a number of different querys. Any ideas? > > -J > > -- > Jesse Brown [jesse.brown@stripped] - PGP Key ID = C4AB128D Hi Jesse How about just using this: SELECT count(*) FROM yourTable WHERE START_TIME < 19990325083159 AND END_TIME > 19990325083159 Tschau Christian