Solved

Retrieving records from ms access for specific dates

Posted on 2009-05-04
1
183 Views
Last Modified: 2012-05-06
Given an MD Access DB with records containing a date, how can retrieve the records for a specific date?  I know how to use the dateadd function to pull the records using the (-) days approach.  

I want to pull records for the past 24 days, one day at a time.  How can I do that?

for rw as integer =24 to 0 step -1
 sql="select * from history where type='cycle' and cycle_date = '" & ???????
next

Any ideas?
0
Comment
Question by:ddepuemd
[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
 

Accepted Solution

by:
ddepuemd earned 0 total points
ID: 24294963
Nevermind, I found my answer by doing this:

sql = "select * from cycle_history where cycle_type='cycle' and job_number='" & jobno & "' and cycle_time >= dateadd(""d"",0,#" & Now.Date.AddDays(-dy) & "#) and cycle_time < dateadd(""d"",0,#" & Now.Date.AddDays(-dy + 1) & "#) order by cycle_time desc"
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

733 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