Hi, I have tried to use this query: SELECT count(smsc_id) as total,
insertdate FROM momtbak WHERE insertdate BETWEEN
DATE_SUB(CURRENT_DATE(), INTERVAL 4 WEEK) AND CURRENT_DATE() group by
week(date_format(insertdate,'%Y-%m-%d'),3) to group records in the
last 4 weeks by week. But the result
Hi,
I finally found the solution
SELECT count( smsc_id ) AS total, week( insertdate ) AS tanggal
FROM momtbak
WHERE insertdate
BETWEEN DATE_SUB( CURRENT_DATE( ) , INTERVAL 4 WEEK )
AND CURRENT_DATE( )
GROUP BY week( insertdate )
Willy
--
MySQL General Mailing List
For list archives:
Hi,
I get stuck to build a query to select records between curdate() and the
last 4 weeks and groupped by week. I tested with:
SELECT *
FROM momtbak
WHERE insertdate
BETWEEN curdate( )
AND curdate( ) - INTERVAL 4 week
It doesn't work. Please help, TIA.
Willy
Every why hath a wherefore. --
On Thu, 2008-12-04 at 08:27 +0700, sangprabv wrote:
Hi,
I get stuck to build a query to select records between curdate() and the
last 4 weeks and groupped by week. I tested with:
SELECT *
FROM momtbak
WHERE insertdate
BETWEEN curdate( )
AND curdate( ) - INTERVAL 4 week
It doesn't
: sangprabv [EMAIL PROTECTED]
Subject: Re: Query to Select records in the last 4 weeks
Date: Wed, 03 Dec 2008 17:52:32 -0800
SELECT * FROM momtbak
WHERE insertdate
BETWEEN DATE_SUB(CURRENT_DATE(), INTERVAL 4 WEEK) AND CURRENT_DATE();
--
MySQL General Mailing List
For list archives: http