Reformat date to the first of the month

F

FL610

I have a list of maintenance events for several years, the events have taken
place on random days of every month, i need to count the events for each
month. With the current date format MM/DD/YYYY i get groupings of events for
that day of the month, and not just the month. I was thinking i'd reformat
the event date to the first of every month, any ideas on how to accomplish
this? Thank you in advance!
 
W

Wayne-I-M

Hi

You don't need to change the date. Just calculate on the month the date is in

In A form
=Month([DateField])

In A query
SELECT Month([YourTable]![Datefield]) AS MonthAsNumber,
MonthName(Month([YourTable]![Datefield])) AS MonthAsText
FROM YourTable;

Use these in a report to "sort by"

Good luck
 
J

Jerry Whittle

Something like the following in a query will convert your dates to the first
day of that month.

FOM: [DateField] - Day([DateField]+1
 
J

Jerry Whittle

Mistake!

FOM: [DateField] - Day([DateField])+1

--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


Jerry Whittle said:
Something like the following in a query will convert your dates to the first
day of that month.

FOM: [DateField] - Day([DateField]+1
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.

FL610 said:
I have a list of maintenance events for several years, the events have taken
place on random days of every month, i need to count the events for each
month. With the current date format MM/DD/YYYY i get groupings of events for
that day of the month, and not just the month. I was thinking i'd reformat
the event date to the first of every month, any ideas on how to accomplish
this? Thank you in advance!
 
F

FL610

Thank you for the quick response! I tried the code below and it changed the
dates to the end of each month, which was still better than any progress i
was making. Using the shotgun approach I changed the '+' at the end to a '-'
and it works great !

Jerry Whittle said:
Mistake!

FOM: [DateField] - Day([DateField])+1

--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


Jerry Whittle said:
Something like the following in a query will convert your dates to the first
day of that month.

FOM: [DateField] - Day([DateField]+1
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.

FL610 said:
I have a list of maintenance events for several years, the events have taken
place on random days of every month, i need to count the events for each
month. With the current date format MM/DD/YYYY i get groupings of events for
that day of the month, and not just the month. I was thinking i'd reformat
the event date to the first of every month, any ideas on how to accomplish
this? Thank you in advance!
 
J

Jose armando Lopez

FL610 said:
Thank you for the quick response! I tried the code below and it changed the
dates to the end of each month, which was still better than any progress i
was making. Using the shotgun approach I changed the '+' at the end to a '-'
and it works great !

Jerry Whittle said:
Mistake!

FOM: [DateField] - Day([DateField])+1

--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


Jerry Whittle said:
Something like the following in a query will convert your dates to the first
day of that month.

FOM: [DateField] - Day([DateField]+1
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.

:

I have a list of maintenance events for several years, the events have taken
place on random days of every month, i need to count the events for each
month. With the current date format MM/DD/YYYY i get groupings of events for
that day of the month, and not just the month. I was thinking i'd reformat
the event date to the first of every month, any ideas on how to accomplish
this? Thank you in advance!
 

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