View Full Version : how to convert a date?


scary1
07-06-2004, 02:19 AM
Someone has set a database up at work with a field “week commencing” in the format dd/mm/yyyy. This is so a record is kept of the date staff send in information as it must be done weekly.
The information now needs to be sent in monthly so I need to add a month field but I want an easy way of picking the month from dates already input and converting it to the format I want so if a date is input as 12/11/2004 I want the detail in the new field to say November!
Any ideas anyone??
Thanks

maxmangion
07-06-2004, 02:36 AM
create a query and create a new field, and place the following:

Expr1: Format([dob],"mmmm")

replace dob with the name of your field containing the date

scary1
07-06-2004, 02:49 AM
Brill thanks very much so I have a column with staff names and then my column of months and then next to that a column of numbers eg

Jill Smith December 26
Jill Smith December 92
Jill Smith December 1
Jill Smith january 5 etc etc

How do I now Get all the decembers to add up in a new table so I could do a make table query so insteda of the above I would have all same months added together like so

Jill Smith December 119
Jill Smith January 5

But not sure how to do it!

Rich
07-06-2004, 02:50 AM
If you use the Format(etc.) method and try and order by it, your query will no longer order correctly, you might have to use a combination of the Month & Year functions. Why don't you tell us exactly what you want to do.

maxmangion
07-06-2004, 02:51 AM
create a total query by clicking on the Σ, then group by month and select sum where you have that number field

Rich
07-06-2004, 03:03 AM
Why would you want to use a make table?