return month names for datedif date 1 and date 2

  • Thread starter Thread starter a.fox
  • Start date Start date
A

a.fox

I have a 'fair' amount of experience with access, very little with SQL
Here's my challenge:

I want to enter in a StartDate and EndDate for an order, Say 01-jul-06
and 31-dec-06 in a table (with a form, or not). I would like new
individual records (for each month) created in another table, with
select information and the month - something like this:

autonum; john doe; $25; July
autonum; john doe; $37; August
autonum; john doe; $45; September

etc...

I'm thinking that a make table query/Append query might be the answer,
but I'm blank on creating the new records. Will I need to use some SQL
or VBA?
I don't mind putting in the hours, but I would appreciate someone who
could point me in the right direction.

Andy
 
Your subject does not match your post.

Then your post mentions entering a StartDate and EndDate but getting out
names and dollars. You left something out of the middle.
 
KARL said:
Your subject does not match your post.

Then your post mentions entering a StartDate and EndDate but getting out
names and dollars. You left something out of the middle.
 
Sorry if it wasn't clear,

I'm thinking I have to use the difference between a start date and an
end date, and from there figure out the number of calendar months
(complete or incomplete) the range of dates cover. Then - by using a
loop of some sort I guess - return the month names.

I need to then create new records with that are duplicates of existing
records with the exception of the new month name. If I have 11 months
difference I'll have 11 new records whose only difference is the month
name field.

I've made some progress, I now have the number of months thing figured
out, trying to discover how to create the records now...ADO, SQL, VBA:
aargh!

Sorry if I breached ettiquette, I thought getting everything into the
subject line would be too wordy.
 
You still did not say why you had the name and dollar amount in your output
example.

Post your table structure.

Are you using two tables - one that has the start date and end date and then
another that you will append to?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top