Create A List Of Dates In A Month

P

PC Datasheet

An Access user saw my name in a newsgroup and sent me a request for help on
a project. As part of the project, a list of the dates in a month was
needed. For anyone needing a list of dates in a month, here is what I used:

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.
 
D

Duane Hookom

I'm not sure why you didn't just put this tip in the Access/Excel Tips page
on your web site (which is blank/under construction)? That's what I believe
most would have done rather than stating that someone asked you a question
off line. I'm not suggesting you didn't get a legitimate question off line
but it is just a bit unusual to post like you did in all these news groups.

I believe there are other forums on the web that are more accepting of
Access tips (and advertising ;-).
 
R

Rob Oldfield

Just in case anyone was also wondering, I had a big money client today who
paid me a small Caribbean island for coming up with this:

function MultByTwo(d as double)
MultByTwo=d*2
end function

I'm particularly proud of that. That's the 57,365th person who's contacted
me because they've seen my name on a newsgroup this month.


Duane Hookom said:
I'm not sure why you didn't just put this tip in the Access/Excel Tips page
on your web site (which is blank/under construction)? That's what I believe
most would have done rather than stating that someone asked you a question
off line. I'm not suggesting you didn't get a legitimate question off line
but it is just a bit unusual to post like you did in all these news groups.

I believe there are other forums on the web that are more accepting of
Access tips (and advertising ;-).

--
Duane Hookom
MS Access MVP
--

PC Datasheet said:
An Access user saw my name in a newsgroup and sent me a request for help
on a project. As part of the project, a list of the dates in a month was
needed. For anyone needing a list of dates in a month, here is what I
used:

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.


--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
Over 1075 users have come to me from the newsgroups requesting help
(e-mail address removed)
 
D

Duane Hookom

We had our company holiday party last night. We paid good money for a
comedian. He could have taken a lesson or two from you....

Keep it coming ;-)

BTW: consider data typing your function
Function MultByTwo(d as Double) as Double

--
Duane Hookom
MS Access MVP
--

Rob Oldfield said:
Just in case anyone was also wondering, I had a big money client today who
paid me a small Caribbean island for coming up with this:

function MultByTwo(d as double)
MultByTwo=d*2
end function

I'm particularly proud of that. That's the 57,365th person who's
contacted
me because they've seen my name on a newsgroup this month.


Duane Hookom said:
I'm not sure why you didn't just put this tip in the Access/Excel Tips page
on your web site (which is blank/under construction)? That's what I believe
most would have done rather than stating that someone asked you a
question
off line. I'm not suggesting you didn't get a legitimate question off
line
but it is just a bit unusual to post like you did in all these news groups.

I believe there are other forums on the web that are more accepting of
Access tips (and advertising ;-).

--
Duane Hookom
MS Access MVP
--

PC Datasheet said:
An Access user saw my name in a newsgroup and sent me a request for
help
on a project. As part of the project, a list of the dates in a month
was
needed. For anyone needing a list of dates in a month, here is what I
used:

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.


--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
Over 1075 users have come to me from the newsgroups requesting help
(e-mail address removed)
 
R

rkc

PC said:
An Access user saw my name in a newsgroup and sent me a request for help on
a project.

I need to find a picture of a smiley face.
Can you help me with that?
 
M

Marshall Barton

Duane said:
We had our company holiday party last night. We paid good money for a
comedian. He could have taken a lesson or two from you....

Keep it coming ;-)

BTW: consider data typing your function
Function MultByTwo(d as Double) as Double


Hey, it was only a small island. For full typing, you have
to throw in a yacht.
 
K

Keith Wilby

Rob Oldfield said:
I'm particularly proud of that. That's the 57,365th person who's
contacted
me because they've seen my name on a newsgroup this month.
<Four Yorkshiremen>
An yuh tell that tuh yung peepul tuday ... an thi don't believe yuh!
</Four Yorkshiremen>
 
G

Guest

Oh, thank you, thank you, thank you. I had been searching all over for this
type of information. Is it OK if I send you lots and lots of money?

PC Goons
Your Resource For Help With Harassment,
Fictitious Emails, Subversive Responses
(e-mail address removed)
www.pcgoons.com

Over 1050 goons have come from the newsgroups, trusting me and requesting
help.
My fees are very reasonable.

I can offer you full training and certification in becoming a goon. Please
contact me, and we can discuss some reasonable fee for this training. For an
extra fee, you can also become trained and certified in being a dimwit.
 
R

Rob Oldfield

Incidentally Steve, I was just browsing Arno's site when I noticed a mail
from you to a previous prospective client including the phrase: "You will
totally own the application; there will be no licensing restrictions."

Did you change your standard terms, or did you ask the owner of this code
for permission to reproduce it here?
 
R

Rob Oldfield

Arno,

You think it would be a good idea to include another section on your site:
how to report abuse to Earthlink? I'm perfectly prepared to help out by
writing it.


Rob Oldfield said:
Incidentally Steve, I was just browsing Arno's site when I noticed a mail
from you to a previous prospective client including the phrase: "You will
totally own the application; there will be no licensing restrictions."

Did you change your standard terms, or did you ask the owner of this code
for permission to reproduce it here?


PC Datasheet said:
An Access user saw my name in a newsgroup and sent me a request for help on
a project. As part of the project, a list of the dates in a month was
needed. For anyone needing a list of dates in a month, here is what I used:

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.


--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
Over 1075 users have come to me from the newsgroups requesting help
(e-mail address removed)
 
D

Douglas J. Steele

I wonder whether
http://news.com.com/Create+an+e-ann...3-6022491.html?part=rss&tag=6022491&subj=news
is relevant here...

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Rob Oldfield said:
Arno,

You think it would be a good idea to include another section on your site:
how to report abuse to Earthlink? I'm perfectly prepared to help out by
writing it.


Rob Oldfield said:
Incidentally Steve, I was just browsing Arno's site when I noticed a mail
from you to a previous prospective client including the phrase: "You will
totally own the application; there will be no licensing restrictions."

Did you change your standard terms, or did you ask the owner of this code
for permission to reproduce it here?


PC Datasheet said:
An Access user saw my name in a newsgroup and sent me a request for
help on
a project. As part of the project, a list of the dates in a month was
needed. For anyone needing a list of dates in a month, here is what I used:

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.


--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
Over 1075 users have come to me from the newsgroups requesting help
(e-mail address removed)
 
R

Rob Oldfield

Well that's just annoying.


Douglas J. Steele said:
I wonder whether
http://news.com.com/Create+an+e-ann...3-6022491.html?part=rss&tag=6022491&subj=news
is relevant here...

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Rob Oldfield said:
Arno,

You think it would be a good idea to include another section on your site:
how to report abuse to Earthlink? I'm perfectly prepared to help out by
writing it.


Rob Oldfield said:
Incidentally Steve, I was just browsing Arno's site when I noticed a mail
from you to a previous prospective client including the phrase: "You will
totally own the application; there will be no licensing restrictions."

Did you change your standard terms, or did you ask the owner of this code
for permission to reproduce it here?


An Access user saw my name in a newsgroup and sent me a request for
help
on
a project. As part of the project, a list of the dates in a month was
needed. For anyone needing a list of dates in a month, here is what I
used:

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.


--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
Over 1075 users have come to me from the newsgroups requesting
help
(e-mail address removed)
 
A

Arno R

Rob Oldfield said:
Arno,

You think it would be a good idea to include another section on your site:
how to report abuse to Earthlink? I'm perfectly prepared to help out by
writing it.

Hi Rob,

Might be a good idea indeed to add another page to the website.
Thanks for the offer to help writing a 'report-abuse' section.
At the moment I am busy with the page 'what's next', (coming soon indeed) since Steve has made his position perfectly clear.

Please contact me offline.

Arno R
 
G

Guest

Oh my. I thought I was being sufficiently outrageous to be recognized as a
satirist from 100 yards away. Do I need to lay it on thicker, then? Or are
you just a little slow today, Keith?

PC Goons
Your Resource For Help With Harassment,
Fictitious Emails, Subversive Responses
(e-mail address removed)
www.pcgoons.com

Over 1050 goons have come from the newsgroups, trusting me and
requesting help.
My fees are very reasonable.

I can offer you full training and certification in becoming a goon. Please
contact me, and we can discuss some reasonable fee for this training. For an
extra fee, you can also become trained and certified in being a dimwit.
 
K

Keith Wilby

PC Goons said:
Oh my. I thought I was being sufficiently outrageous to be recognized as
a
satirist from 100 yards away. Do I need to lay it on thicker, then? Or
are
you just a little slow today, Keith?

I don't think so, it was my attempt at humour, I must try harder :) Are
you a good a sitarist as Ravi Shankar? ;-)
 
G

Guest

OUCH! Not often I get slapped in the head this early in the morning. Good
shot, by the way . . .

Seriously, though, I actually have the album (on an LP that I purchased new
whilst in high school, which demonstrates my age and maturity) of Ravi
Shankar and Yehudi Menuhin playing together. The album is called "West meets
East." I never played a sitar myself, but do play piano and string bass.

**reminder to self: Be very very careful exchanging witticisms with Keith**

PC Goons
Your Resource For Help With Harassment,
Fictitious Emails, Subversive Responses
(e-mail address removed)
www.pcgoons.com

Over 1050 goons have come from the newsgroups, trusting me and
requesting help. My fees are very reasonable.

I can offer you full training and certification in becoming a goon. Please
contact me, and we can discuss some reasonable fee for this training. For an
extra fee, you can also become trained and certified in being a dimwit.
 

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

Top