Click to See Complete Forum and Search --> : sql query with timestamp


agent_bozo
04-18-2006, 10:23 AM
Hi I'm trying to run a sql query on the following database table for a particular year and month ( ls_timestamp) and also so that it returns the ls_searchword and counts the number of times it occurs for that particular month.

ls_id ls_searchword ls_timestamp ls_domain
1 1 2006-04-04 15:30:30 1
2 1 2006-04-04 15:12:04 1
3 2 2006-04-04 15:13:17 1
4 2 2006-04-04 15:33:19 1
5 3 2006-04-04 15:34:06 1
6 4 2006-04-04 15:34:41 1

Any ideas?

chazzy
04-18-2006, 10:26 AM
so what is the problem exactly?

agent_bozo
04-18-2006, 10:34 AM
need to know how to run a sql query where I'm specifying a range (i.e. 1/1/2005 to 1/2/2005) for the timestamp column

chazzy
04-18-2006, 11:42 AM
...WHERE date_column BETWEEN STR_TO_DATE('01/01/2005', '%m/%d/%Y') AND STR_TO_DATE('01/02/2005', '%m/%d/%Y');