You can adapt the procedure below my signature line to do what you want ---
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
Over 1125 users have come to me from the newsgroups requesting help
(e-mail address removed)
1. Create a table named TblNumbers with one field named Num and populate
the table with 1 to 31
2. Create a query based on TblNumbers
3. Pull down Num into the first field of the query.
4. Put the following expression in the criteria for Num:
<=Day(DateSerial(6,1+1,0))
5. Put the following expression in the second field of the query:
MonthDate: DateSerial(6,1,[Num])
6. Put the following expression in the third field of the query:
=Day([MonthDate])
7. Put the following expression in the fourth field of the query:
=Format([MonthDate],"ddd")
8. Put the following expression in the fifth field of the query:
= Format([MonthDate],"dddd")
9. Run the query.
The query will return all the dates for this month (January 06) in the
second column. The third column will contain the day of the month for each
date. The fourth column will contain the three letter abbreviation for the
day of the week for each date. The fifth column will contain the full name
of the day of the week for each date.
In the DateSerial expression, 6 is the year (06) and 1 is the number of the
month. You can make the query return the dates for any year and month by
modifying the DateSerial function to make the 6 and 1 selectable on a form.
kdaniel7979 said:
I'm trying to get a table / report to look like this (below) based on
the input of 3 variables (Cost; Start Date; End Date) I have started
with diffdate which is helpful. But getting this information into
Jan-06, Feb-06 fields seems overwhelming. May start date and End date
may be 4-5 years apart. Am I overlooking an easier way to extrapolate
this information?
Thanks
Input variables
Cost Start End Jan-06 Feb-06 Mar-06 Apr-06 May-06 Jun-06
A $30 Jan-06 Mar-06 $10 $10 $10
B $80 Feb-06 May-06 $20 $20 $20 $20
C $10 Mar-06 Apr-06 $5 $5
D $30 May-06 Jun-06 $15 $15
Sum $10 $30 $35 $25 $35 $15
PS I have a rough idea how to do this in Excel, but I want to stay in
Access