Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA to create table with date range 1

Status
Not open for further replies.

striker83716

Technical User
Jul 28, 2002
76
US
I have an access table that has two date fields. These fields are titled StartDate and EndDate. They represent a range of time. I am simply wanting to put these ranges into a new single column table using VBA. The range needs to include the StartDate, EndDate and include every date that is in between those dates.

Any thoughts?
 
I would not recommend you put these into a single column.

When you create a query to find records within the date range use the BETWEEN operator it includes the endpoints by default.

Lookup the Between operator for more info.

 
Thanks for your recommendation, and I agree that doing this is not the normal practice. But because of the complexity of this project, I must do it this way. By the way this is a temp table that will be deleted and replaced every time the code is executed/report is needed.
 
Thanks for your help jedraw!, After walking away and thinking about your reply, I realized you were right. I now have a query giving me the results that I need.

Thanks again, and have a star!
 
1) Why?
2) What are you really trying to accomplish?
3) Can you give an example of what you expect the final result to look like.

I can interpret this many different ways, can you be clearer? Most likely you will not want to write this to the table, but display the results in a query.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top