Searching criteria based on date/time

I am using access database (mdb). I have a Date/Time field in the database. My application allows user to enter start date and end date as searching criteria. How do I construct a sql query to do such search ? I am using ADO.

Thanks.
MyQ2004Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
bcsonkaConnect With a Mentor Commented:
Hi,

Give something like this a shot:

===========================================================

rs->Open("Select * from MyTable Where <date_field> between #<begin_date># and #<end_date>#", conn.GetInterfacePtr(), adOpenForwardOnly, adLockReadOnly, adCmdText);

===========================================================

rs = Instance of _RecordsetPtr
conn = Instance of _ConnectionPtr

I hope that helps.
0
All Courses

From novice to tech pro — start learning today.