- Original Message -
From: Renish
To: Visolve DB Team ; mysql@lists.mysql.com
Sent: Tuesday, October 10, 2006 12:35 PM
Subject: Fw: Query Help plss
- Original Message -
From: Renish
To: mysql@lists.mysql.com ; Visolve DB Team
Sent: Tuesday, October 10, 2006 12:34 PM
- Original Message -
From: grKumaran [EMAIL PROTECTED]
To: mysql@lists.mysql.com
Sent: Tuesday, October 18, 2005 16:08
Subject: query help
: Hello,
:
: CREATE TABLE t (
: dt datetime
: )
:
: Please assume this is the table structure and contains thousands of
records.
: And I want to list
[EMAIL PROTECTED] wrote on 10/18/2005 12:01:50 PM:
- Original Message -
From: grKumaran [EMAIL PROTECTED]
To: mysql@lists.mysql.com
Sent: Tuesday, October 18, 2005 16:08
Subject: query help
: Hello,
:
: CREATE TABLE t (
: dt datetime
: )
:
: Please assume this is the table
Hi,
The following query will probably work but I think it will be easier to pass
the minimum date from your application.
SELECT * FROM t WHERE (year(dt)=year(Now()) and dtNow()) or
(year(dt)=year(Now())-1 and month(dt)month(Now()))
Also you might want to check the other Date and Time functions
: : Hello,
: :
: : CREATE TABLE t (
: : dt datetime
: : )
: :
: : Please assume this is the table structure and contains thousands of
: records.
: : And I want to list them only last 12 months (that mean last 1 year)
: records
: : exactly.
: :
: : For that I tried using the following
[EMAIL PROTECTED] wrote:
[EMAIL PROTECTED] wrote on 10/18/2005 12:01:50 PM:
- Original Message -
From: grKumaran [EMAIL PROTECTED]
To: mysql@lists.mysql.com
Sent: Tuesday, October 18, 2005 16:08
Subject: query help
: Hello,
:
: CREATE TABLE t (
: dt datetime
: )
:
: Please assume
Dobromir Velev wrote:
Hi,
The following query will probably work but I think it will be easier to pass
the minimum date from your application.
SELECT * FROM t WHERE (year(dt)=year(Now()) and dtNow()) or
(year(dt)=year(Now())-1 and month(dt)month(Now()))
Also you might want to check the
grKumaran wrote:
Hello Folks,
It is great help. Thank you all and specially for Michael and Shawn. It
does work properly in 4.1.9-max. But I think, LAST_DAY function does not
availble in old MySQL version 4.0.??, so there I have problem, actually our
webserver is still in that version. So