473,383 Members | 1,803 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Access-SQL-Break out a date Range?

i have a table that has a beg_date & end_date (3/1/1985 & 3/1/1990)
how do i, in access, break out this date range into another table by month. since this date range is a 60 month range it would insert 60 lines of data into the new table. (3/1/1985, 4/1/1985, 5/1/1985, etc). there will be mulitple dates to break out with various ranges.

thanks
mintz
Mar 28 '08 #1
8 3654
PianoMan64
374 Expert 256MB
i have a table that has a beg_date & end_date (3/1/1985 & 3/1/1990)
how do i, in access, break out this date range into another table by month. since this date range is a 60 month range it would insert 60 lines of data into the new table. (3/1/1985, 4/1/1985, 5/1/1985, etc). there will be mulitple dates to break out with various ranges.

thanks
mintz
Are you trying to back the information up into another table that is going to be sum of each month's data in each record?

If that is the case, the easiest way to do this would simply be is to create a select query that selects all the data in the date range that you seek ex. Between #3/1/1985# and #3/1/1990#

After you have that, change the Date field so that it only displays month and year only. by creating a Date Expression TheMonth:=Format({TheNameOfTheDateField},"MM/YYYY")

So it will display the month and year of each item in the select query.

Then you simply use the group by option which is the ε (Sum) symbal that is in the query designer.

Then you simply select which items you want to sum, and which ones you want to count, or what ever you want there.

Once you have all that design and displaying the way that you want it to work, you simply change the query from a select query to a Make Table query and you're all done.

Hope that helps,

Joe P.
Mar 29 '08 #2
Are you trying to back the information up into another table that is going to be sum of each month's data in each record?

If that is the case, the easiest way to do this would simply be is to create a select query that selects all the data in the date range that you seek ex. Between #3/1/1985# and #3/1/1990#

After you have that, change the Date field so that it only displays month and year only. by creating a Date Expression TheMonth:=Format({TheNameOfTheDateField},"MM/YYYY")

So it will display the month and year of each item in the select query.

Then you simply use the group by option which is the ε (Sum) symbal that is in the query designer.

Then you simply select which items you want to sum, and which ones you want to count, or what ever you want there.

Once you have all that design and displaying the way that you want it to work, you simply change the query from a select query to a Make Table query and you're all done.

Hope that helps,

Joe P.




All i am trying to do is to break out that date range per line and input that into another table. I just need the code to do that in Access.
thanks
m3ntZ
Mar 31 '08 #3
PianoMan64
374 Expert 256MB
All i am trying to do is to break out that date range per line and input that into another table. I just need the code to do that in Access.
thanks
m3ntZ
But as I explained in my answer before, all you need to do is create a Append Query with Group BY option to do what it is that you want to do. If you follow my instructions that I laid out for you, that is the simplest way to accomplish what it is that you need to do.

Since I don't have data examples, and table structure, it's kind of hard to give you the exact code that you seek.

Hope that helps,

Joe P.
Mar 31 '08 #4
But as I explained in my answer before, all you need to do is create a Append Query with Group BY option to do what it is that you want to do. If you follow my instructions that I laid out for you, that is the simplest way to accomplish what it is that you need to do.

Since I don't have data examples, and table structure, it's kind of hard to give you the exact code that you seek.

Hope that helps,

Joe P.

There is nothing to select as far as dates. my table is the following: Lease_Tb - ID (Primary_key), Beg_date, End_date, Store_Num, Rent
there will be several 100's of lines in this table haveing different date ranges (the date range is from Beg_date thru End_Date. i have to have code generic enough to break this Date Range out on a per month to show the $$$ (Rent) that we are paying on a monthly basis. The final view will look like:
Date - Rent - Store #
2/1985 - $3500.00 - 1234
2/1985 - $3700.00 - 4567
3/1985 - $3500.00 - 1234
3/1985 - $3700.00 - 4567
Etc.

Thanks
m3ntZ
Mar 31 '08 #5
PianoMan64
374 Expert 256MB
There is nothing to select as far as dates. my table is the following: Lease_Tb - ID (Primary_key), Beg_date, End_date, Store_Num, Rent
there will be several 100's of lines in this table haveing different date ranges (the date range is from Beg_date thru End_Date. i have to have code generic enough to break this Date Range out on a per month to show the $$$ (Rent) that we are paying on a monthly basis. The final view will look like:
Date - Rent - Store #
2/1985 - $3500.00 - 1234
2/1985 - $3700.00 - 4567
3/1985 - $3500.00 - 1234
3/1985 - $3700.00 - 4567
Etc.

Thanks
m3ntZ
Ok, now that I know what it is that you want, can I have an example of what the data look like that you're wanting to sum together by month?

Thanks,

Joe P.
Apr 1 '08 #6
Ok, now that I know what it is that you want, can I have an example of what the data look like that you're wanting to sum together by month?

Thanks,

Joe P.

I'm not sure where "sum" is coming from, but i'm not trying to sum anything.
i am taking the beg_date column, the end_date column and breaking the range out per month into a new table.

i know that i am going to use the DateDiff to calculate the number of months and put that into a loop to add the months to the beg_date to get the date range broke out. i'm just not sure how to put that all together and get the syntax correct for access.

thanks
m3ntZ
Apr 1 '08 #7
PianoMan64
374 Expert 256MB
I'm not sure where "sum" is coming from, but i'm not trying to sum anything.
i am taking the beg_date column, the end_date column and breaking the range out per month into a new table.

i know that i am going to use the DateDiff to calculate the number of months and put that into a loop to add the months to the beg_date to get the date range broke out. i'm just not sure how to put that all together and get the syntax correct for access.

thanks
m3ntZ
So if I understand your request, you're wanting a table created that will create a table for each month since the month and year of the Beg_date to current to figure out how much rent has been collected and/or Bill for that location?

If so let me know,

Joe P.
Apr 1 '08 #8
So if I understand your request, you're wanting a table created that will create a table for each month since the month and year of the Beg_date to current to figure out how much rent has been collected and/or Bill for that location?

If so let me know,

Joe P.

No collections, no rent, just take the rent piece out of the equation. I just need code that will create a table that will break out the months by using the beg_date through end_date. That’s all I need.

m3ntZ
Apr 1 '08 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Dave | last post by:
Hello NG, Regarding access-declarations and member using-declarations as used to change the access level of an inherited base member... Two things need to be considered when determining an...
14
by: wolftor | last post by:
1) Is there a free runtime version of Access available that is more recent than the one for Access 2000? 2) If I create an application (MDE) in A2K, will it run on all later versions of Access?...
47
by: ship | last post by:
Hi We need some advice: We are thinking of upgrading our Access database from Access 2000 to Access 2004. How stable is MS Office 2003? (particularly Access 2003). We are just a small...
0
by: com | last post by:
MS Access 2000 Password Recoverer 4.2 Screenshot - Soft30.com MS Access 2000 Password Recoverer will display the password to a MS Access database (*.mdb). This program works for MS Access files...
4
by: bbdobuddy | last post by:
Hi, How do I open a Microsoft Access 2003 form from Visual Basic.net Thanks in advance bbdobuddy
37
by: jasmith | last post by:
How will Access fair in a year? Two years? .... The new version of Access seems to service non programmers as a wizard interface to quickly create databases via a fancy wizard. Furthermore, why...
34
by: Mathieu Trentesaux | last post by:
Hello I downloaded Office 2007 for this reason : It seems, once again, that it is impossible to save any modification done in a VBA library, from the main project in Access. The save button...
37
by: Allen Browne | last post by:
If you develop for others, you probably have multiple versions of Access installed so you can edit and create MDEs for clients in different versions. This works fine under Windows XP, even with...
17
by: Neil | last post by:
A client of mine likes some of the new bells and whistles in Access 2007, and is thinking about converting our A03 format MDB to an A07 format file. However, while some of the users have A07, many...
0
by: Sebastian | last post by:
Hello I develop my applications in Access 2002. My development system is running Windows XP SP2 and I have Microsoft Office XP Developer. Microsoft Office XP is at SP3. I used Inno Setup (great...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.