Home arrow static arrow Java Programming [Archive] - Retreiving data of the current month
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - Retreiving data of the current month
This topic has 1 reply on 1 page.

Posts:2
Registered: 7/19/04
Retreiving data of the current month  
Jul 20, 2004 11:49 PM



 
Hi i need to know how to retreive data for the current month from a data base.I have an attribute date_created,which stores time stamps.I need to get data only in the month July for example.Thanx for helpin. =]
 

Posts:1,695
Registered: 1/13/04
Re: Retreiving data of the current month  
Jul 21, 2004 12:19 AM (reply 1 of 1)



 
SELECT * FROM <yourTable> WHERE MONTH(date_created) = <yourMonth> 

or
SELECT * FROM <yourTable> WHERE <yourTable>.date_created BETWEEN <firstDayOfMonth> AND <lastDayOfMonth>

or
SELECT * FROM <yourTable> WHERE <yourTable>.date_created >= <firstDayOfMonth>   AND <yourTable>.date_created < <firstDayOfNextMonth>

BTW: this topic had nothing to do with Java Programming... you should have posted it to http://forum.java.sun.com/forum.jsp?forum=48

Hope this helped,
Regards.
 
This topic has 1 reply on 1 page.