If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Converting a Date
I have a column with dates in the format mm/dd/yyyy. I would like to have an
additional column the will give me only the month and another only the year, all from the above date column Pls Advise. Thankyou. |
#2
|
|||
|
|||
Converting a Date
Do not store the month and year in other columns. Instead extract the month
and years using the Month() and Year() functions. They will give you number of both. For example today (March 19, 2010) will show up as 3 for the month. If you need to see March instead of 3, use the Format Function something like below: Format([TheDateColumn], "MMMM") -- Jerry Whittle, Microsoft Access MVP Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder. "FC" wrote: I have a column with dates in the format mm/dd/yyyy. I would like to have an additional column the will give me only the month and another only the year, all from the above date column Pls Advise. Thankyou. |
#3
|
|||
|
|||
Converting a Date
You posted in a newsgroup that supports the use of queries in MS Access.
Before you go any futher, remember that how data is stored in a table IS NOT the same as how you may have chosen to display it (i.e., the "format"). First, is your underlying date stored in an Access date/time field? If so, you can use the Access date/time functions to create additional columns in your query. To get the month of your date, you could use the Month() function on the date, or you could use something like (untested): YourMonth: Format([datefield],"mmmm") Similarly, you could use the Year() function or format the date to display only the "yyyy". Good luck! Regards Jeff Boyce Microsoft Access MVP -- Disclaimer: This author may have received products and services mentioned in this post. Mention and/or description of a product or service herein does not constitute endorsement thereof. Any code or pseudocode included in this post is offered "as is", with no guarantee as to suitability. You can thank the FTC of the USA for making this disclaimer possible/necessary. "FC" wrote in message ... I have a column with dates in the format mm/dd/yyyy. I would like to have an additional column the will give me only the month and another only the year, all from the above date column Pls Advise. Thankyou. |
Thread Tools | |
Display Modes | |
|
|