Solved

Retrieving records from ms access for specific dates

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

707 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now