MySQL Forums
Forum List  »  Newbie

Re: Date
Posted by: Felix Geerinckx
Date: April 27, 2005 05:33AM

Bharati Raul wrote:

> I want to compare the date field i.e "v2.date_visit", which is in bigint(20) format in
> the following query.

Why aren't you using TIMESTAMP or DATETIME column types?

> Say I want to extract the record whose visit date is between 1st Jan 2005 to
> 31st Jan 2005.

1st Jan 2005 -> 20050101000000
31st Jan 2005 -> 20050131235959

So

SELECT ... FROM foo where ts BETWEEN 20050101000000 AND 20050131235959

should work.

--
felix

Options: ReplyQuote


Subject
Written By
Posted
April 26, 2005 11:58PM
April 27, 2005 02:26AM
April 27, 2005 04:17AM
April 27, 2005 05:13AM
April 27, 2005 05:17AM
Re: Date
April 27, 2005 05:33AM
April 27, 2005 05:41AM
April 27, 2005 06:21AM
April 27, 2005 11:06PM
May 02, 2005 07:44AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.