Solved

Retrieving records from ms access for specific dates

Posted on 2009-05-04
1
174 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
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

776 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