Need query to select the records between two dates in msaccess

Posted by Prabu_Spark under ASP.NET on 1/2/2013 | Points: 10 | Views : 2360 | Status : [Member] | Replies : 2
Hi sir,
How to select the records between two dates in msaccess. I need query for that.I executed the below query, it shows datatype mismatch error.

Query:
**********
select * from Checkinout where CheckTime between '2011-13-06' and '2011-06-14'

[Hint: CheckTime belongs to datetime datatype in ms-access]

With regards,
J.Prabu.
[Email:prbspark@gmail.com]



Responses

Posted by: Ranjeet_8 on: 1/3/2013 [Member] [MVP] Gold | Points: 25

Up
0
Down
Try this,

Select * From TABLE_Name where format(Column_Name,"dd/mm/yyyy") BETWEEN
format(#04/04/2010#,"dd/mm/yyyy") AND format(#09/05/2011#,"dd/mm/yyyy")


Please Mark As Answer if this helps you
.

Prabu_Spark, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Rrana on: 1/4/2013 [Member] Starter | Points: 25

Up
0
Down
Hi,

Try this query

select * from Checkinout where CheckTime>=#2011/13/06# and CheckTime<=#2011/06/14#



Sucharitha Goud
Bank Of America..

Prabu_Spark, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response