How to query date between?
am 26.07.2006 05:04:07 von nx2zdk
I have table name "actionlog",and one field in there is "date_time"
date_time (Type:datetime) example value : 11/1/2006 11:05:07
if I'd like to query date between 24/07/2006 to 26/07/2006(I don't
need time),how to write SQL command?
select * from actionlog where date_time > 24/07/2006 AND date_time <
24/07/2006 ??
Re: How to query date between?
am 26.07.2006 06:35:46 von Jared
query is correct but you will need to format your date like so yyyy-MM-dd
YourSQL = "select * from table where date_col < " +
yourdate.tostring("yyyy-MM-dd") " AND ..."
"zdk" wrote in message
news:1153883047.786718.130500@m73g2000cwd.googlegroups.com.. .
>I have table name "actionlog",and one field in there is "date_time"
> date_time (Type:datetime) example value : 11/1/2006 11:05:07
>
> if I'd like to query date between 24/07/2006 to 26/07/2006(I don't
> need time),how to write SQL command?
>
> select * from actionlog where date_time > 24/07/2006 AND date_time <
> 24/07/2006 ??
>
Re: How to query date between?
am 26.07.2006 07:38:15 von nx2zdk
Thanks a lot.
Jared wrote:
> query is correct but you will need to format your date like so yyyy-MM-dd
>
> YourSQL = "select * from table where date_col < " +
> yourdate.tostring("yyyy-MM-dd") " AND ..."
>
> "zdk" wrote in message
> news:1153883047.786718.130500@m73g2000cwd.googlegroups.com.. .
> >I have table name "actionlog",and one field in there is "date_time"
> > date_time (Type:datetime) example value : 11/1/2006 11:05:07
> >
> > if I'd like to query date between 24/07/2006 to 26/07/2006(I don't
> > need time),how to write SQL command?
> >
> > select * from actionlog where date_time > 24/07/2006 AND date_time <
> > 24/07/2006 ??
> >