Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Searching criteria based on date/time

Posted on 2004-10-27
1
Medium Priority
?
184 Views
Last Modified: 2013-11-20
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.
0
Comment
Question by:MyQ2004
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 2

Accepted Solution

by:
bcsonka earned 150 total points
ID: 12424911
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

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question