Convert date to months

I have a database that has multiple dates in it. What I am trying to do is in
one field I have a date and I am want that date to convert to months in
another field. Can anyone help me on this.

-- 
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-queries/200707/1

0
bohon79
7/4/2007 2:36:43 PM
access.queries 6343 articles. 1 followers. Follow

7 Replies
1717 Views

Similar Articles

[PageSpeed] 42

are you trying to find months between dates? or convert 4 to April?


Look at format function for ways to display months, datediff function for 
months difference..


"bohon79 via AccessMonster.com" <u35329@uwe> wrote in message 
news:74ac2f3f40ce9@uwe...
>I have a database that has multiple dates in it. What I am trying to do is 
>in
> one field I have a date and I am want that date to convert to months in
> another field. Can anyone help me on this.
>
> -- 
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access-queries/200707/1
> 


0
David
7/4/2007 3:09:03 PM
This is what i need it to do:

I in put into field1=03 dec 03, then I want field2 to automaticaly
input=43mths

-- 
Message posted via http://www.accessmonster.com

0
bohon79
7/4/2007 3:55:26 PM
On Wed, 04 Jul 2007 15:55:26 GMT, "bohon79 via AccessMonster.com" <u35329@uwe>
wrote:

>This is what i need it to do:
>
>I in put into field1=03 dec 03, then I want field2 to automaticaly
>input=43mths

because today's date is 43 months after 3 Dec 03?

If so, Field2 should NOT be stored in your table at all; any value you put
into it today will be WRONG next month.

Instead, use a calculation in the Control Source of a form or report textbox:

=DateDiff("m", [Field1], Date())

to calculate the number of months between the value in field1 and today's
date.

             John W. Vinson [MVP]
0
John
7/4/2007 5:09:23 PM
so you're actually wanting to display the number of months elapsed from the
first date...to *today*? to calculate that value, use the DateDiff()
function as David suggested. read up on the DateDiff() function topic in
Access Help, so you'll understand how it works.

hth


"bohon79 via AccessMonster.com" <u35329@uwe> wrote in message
news:74acdef9d9437@uwe...
> This is what i need it to do:
>
> I in put into field1=03 dec 03, then I want field2 to automaticaly
> input=43mths
>
> -- 
> Message posted via http://www.accessmonster.com
>


0
tina
7/4/2007 5:20:04 PM
it worked but how do I get the word mths behind the number

-- 
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-queries/200707/1

0
bohon79
7/4/2007 5:32:24 PM
On Wed, 04 Jul 2007 17:32:24 GMT, "bohon79 via AccessMonster.com" <u35329@uwe>
wrote:

>it worked but how do I get the word mths behind the number

Just concatenate a literal text string:

=DateDiff("m", [Field1], Date()) & "mths"



             John W. Vinson [MVP]
0
John
7/4/2007 5:52:10 PM
never mind found the answer on the word mths thing just came to my mind

-- 
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-queries/200707/1

0
bohon79
7/4/2007 5:58:54 PM
Reply:

Similar Artilces:

SQL statment to convert integer to string
Dear all, I have a select statement "select year from table1" , where year is an integer type. How can I convert the year to string in sql. I have try "select cstr(year) as year-string from table 1". But it is failed. Please help. On 21 feb, 09:48, hon123456 <peterhon...@yahoo.com.hk> wrote: > Dear all, > > =A0 =A0 =A0 =A0I have a select statement "select year from table1" , wher= e > year is an integer type. How can I > convert the year to string in sql. I have try "select cstr(year) as > year-string from table ...

Can't get dates to format corrrectly.
Hi, I ran a MS-Access query to pull in some data from our database and one of the date fields has the data formatted as either MM/DD/YYYY or YYYY-MM-DD. I want to change the data on the Excel sheet so that all rows display this date as MM/DD/YYYY. I tried to obvious of selecting the entire column and setting the format to just that date format but still those dates remain formatted as YYYY-MM-DD. When the data came into Excel it was set to a general format for that particular column. Any ideas on how I can accomplish this? You might try this: go to any blank cell off to the side an...

Dating using workdays
Is there a way to autofill dates into a spreadsheet and only use workdays and not Saturdays and Sundays? no Depending on version yes, put the first date in a cell, right click the cell and copy it down, when you release the mouse button you can select weekdays.. -- Regards, Peo Sjoblom "Bill" <anonymous@discussions.microsoft.com> wrote in message news:012a01c3d543$6c197a40$a301280a@phx.gbl... > no You could try this. Put a non weekend-date in A1 Put this formula in A2 =IF(WEEKDAY(A1)=6,A1+3,A1+1) Copy it down -- HTH Bob Phillips ... looking out across Poo...

Excel Bi-weekly time sheet change dates to Thursday- Wednesday?
I downloaded a Bi-weekly timesheet for Excel. The timesheet is perfect except for the date part. The time sheet comes with a Monday to Friday bi-weekly time set-up and I need to change it to a Thursday to Wednesday bi-weekly time set-up. At present I had to individually change the days starting with the Thursday and when I change the start date and ending dates the only days that automatically change are the first Thursday to Sunday settings (4 days). How do I set it up so that all days change when I put the start date and end date at the top of the sheet? Hi Starting with the cel...

Input a date using a Form Button.
Hi, Please help as I'm totally lost with this one! I'm doing a little project for work and I have come across a littl problem with a date input that I have set up using a Form Button. No this button once pressed enters the date just as I want, into th correct Cell (the buttons called "Todays Date") Now I have recorded macro so that the button executes the =TODAY() comand - which is fin untill the date changes!! As you can emagine I need the date to stay a it was when first pressed as its a database I'm trying to compile. Does this make any sense to you all?? I will...

Generate Payment Due Date to exclude Weekends and Public Holiday
I have a table with Column A = Invoice Date Column B = Days of Credit Granted Column C = Payment Due Date Column E = List of Public Holiday with the first row as header and subsesquent rows as the actual data what i want to do is to auto generate the payment due date of each invoices so that it won't falls on weekends and public holiday. for example, if [Invoice Date] + [Days of Credit Granted] falls on a saturday, then the due date will be push forward 2 days to monday. i came out with a formula which works pretty fine given that there's no consecutive non-working days ...

In Publisher 2003, convert endnotes to footnotes
How do you convert endnotes to footnoests in Publisher 2003 How do you automatically place footnoes in Publishr 2003 In WORD its easy, but can't determine how to do it in publisher. If impossible in Publisher 2003 Is there a Utility that accomplishes this?? jerome <jerome@discussions.microsoft.com> was very recently heard to utter: > How do you convert endnotes to footnoests in Publisher 2003 Footnotes and endnotes are both things which don't exist as separate functions in Publisher. > How do you automatically place footnoes in Publishr 2003 You cannot. > If imp...

Date Function
I have two different users, who have the same machines and the same version of office. However when one of the users types in a date; i.e - 10/02/2005, and then goes to format the cell, they can click on a date type that will look like; "*Thursday 10 February 2005". However on the second users machine this function is not present, all they have the option of is; "*10 February 2005". I dont know why it is missing of the day?? Can someone please help me? -- andyb7901 ------------------------------------------------------------------------ andyb7901's Profile: http:/...

macro to find date format in a cell and delete that entire row
macro to find date format in a cell and delete that entire row i have dates in a column and date keeps changing, i want that if macro find date in a column , it deletes that entire row help me thank u so much everyone for ue hel -- Message posted from http://www.ExcelForum.com try Sub deletedate() For Each c In Selection If IsDate(c) Then c.EntireRow.Delete Next End Sub -- Don Guillett SalesAid Software donaldb@281.com "vikram >" <<vikram.15ix9t@excelforum-nospam.com> wrote in message news:vikram.15ix9t@excelforum-nospam.com... > macro to find date format in a ...

How can i change cell colour depending on month of date in cell?
I have a column with a range of dates corresponding to when an item was tested and would like to automatically change the colour depending o which month it was tested. Jan-Mar = red, Apr-Jun= green, Jul-Sep blue and Oct-Dec= yellow. No date = no colour. Anyone have an suggestions? Do I need to run a macro or is there a simpler way? Thanks And -- andy7 ----------------------------------------------------------------------- andy75's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=3017 View this thread: http://www.excelforum.com/showthread.php?threadid=49860 ...

COUNTIF function with date range
Is there anyway to use the COUNTIF function with a date range. I'm trying to count each date within a particular month. For example, =COUNTIF(G5:G100, "12/**/03" And this example with the wildcards is currently not working. Thanks. Amy Hi, Try, =SUMPRODUCT(--(MONTH(G5:G100)=12)) Hope this helps! In article <fd8501c43e96$22a9daf0$a401280a@phx.gbl>, "Amy" <anonymous@discussions.microsoft.com> wrote: > Is there anyway to use the COUNTIF function with a date > range. I'm trying to count each date within a particular > month. For ...

Converting varying length Vertically-aligned records to Horizontal Rows of list (tabular)
I have a Excel Spreadsheet with Records of books. The fields and data value is entered as the First and Second Column (ColA, ColB). The records are separated by 2 empty rows. Some fields are missing for some records: Some record may miss the 'author' whereas some records may miss some other fields, say ,'subject' AND 'totalpage'. The Objective is to tranform the record horizontally with Each ffield in one column with missing field blanked so that all the field are aligned in a column e.g. colA for 'Title', colB for 'Author' How can we convert varying ...

Inbox Date Stamp Is Wrong
In Outlook 2003, the date on received emails is already showing the year 2004. My system date is set correctly. I have sent and had others send me emails through both of my accounts and the date still comes through as 2004. Should I create a new profile? Is there a place to modify this somewhere in Outlook or in the registry? Thanks for your ideas. Dave hmmm. if your clock is right and the senders clock is right then .. is it an ISP problem ? is it the 'sent' or 'received' time which is wrong ? are they the same ? are they logical ? N "Dave T." <anony...

visio current date and time fields
How can i search a shape's text for occurrences of current date and time fields. Is there a way I can just search the text for a time field and a date field of any format? Thanks in advance. Hello Biggaford, The text of the shape will only return a mix of the inserted field and so you would be able to check for the the 'current date/time' as opposed to just an abitary date using Edit / Find. If you know the format that was used for the inserted fields you might be able to search using a pattern such as: ^?^?/^?^?/^?^?^?^? ....which will return a match for a date. Other...

Show only Journal entries in Delete bin, sort by deletion date
I posted a number of times about the problems I encountered with Ctrl- D (delete a Journal item) being right beside Ctrl-S (saving a journal item). On occasions where I actually notice an accidental deletion, one thing that could help is to be able to view only journal items in the Delete bin. Is there a way to do this? Another thing that might help is to be able to sort by deletion date. Is there a way to do this? Sometimes, I accidentally delete a journal entry from way back, and that basically means its buried in the Delete bin (which is normally sorted by date). Even if the d...

X axis months are truncated??
I have four Excel charts. The first one has the months from Jan through Dec in three letter format. The 2nd through 4th appear as Jan, Feb, Mar, Apr, Ma, Jun, Jul, Au, Se, Oct, No, Dec. Why are these four months truncated to two letters each while the other eight are in the desired three letter format. The names of the months for the four charts all come from the same column on the Chart Data table. Paul, Check to make sure that all of your charts and chart plot areas are uniformly sized and that the X-axis fonts and font sizes are exactly the same. At times I've experienced tha...

re-order items based on the average monthly sales
We want to set up our inventory items to reorder based on the average monthly sales x 6 (for a 6 month supply)- (amount on hand + on order). ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.com/Businesssolutions/Community/NewsGroups/dgbrowser/en-us/...

Calendar, in month view
Calendar used to open with a blue cell highlighted in the current day and date. After some "auto" updates that is no longer the case. (MS Office XP sp3). I have done the uninstall and reinstall Outlook, but change. Anyone else with this issue? -- Thanks for taking time to respond to the "Searcher". ...

Printing Dates on One Sheet
I have one template that i print for our production floor. Each sheet has seven dates printed; Monday thru Sunday. I need to print this one template 52 times for each week of the year. Is there a formula that i could enter one day (i.e. the first date for the first monday) and automtically print the rest of the weeks. in essence, press the print button one time, but the same template will print 52 times with each week on the sheet? So you have 7 rows on each sheet and 52 sheets? If I were you, I'd collate everything on one summary sheet and filter your data there. Check...

Transaction versus Post Dates
I'm a long time customer of Microsoft Money and I have recently ran into a problem that I believe would be solved with offering the ability to track transaction and account posting dates separately. Right now with Microsoft Money (I'm using version 2005), one must choose if he/she wishes to use the date as the time of the actual transaction or the date it posted to the account. Naturally using the posting date would be advantageous when sync'ing with your bank and performing balances. However, this gets me into a problem with taxes. I track sales tax of EVERY transaction...

Date Difference Calculation Between two Records
If somebody can help me , regarding calculating difference of days between to records. Ex: Record No: Date: Receipts Payments 123 01/04/2007 10000 456 10/04/2007 5000 789 20/05/2007 500 What i need is calculate date difference in two records Record No: Diff 456 9 Days 789 40 Days I need this days for interest calculation if somebody could please suggest how to calculate this date difference in query i will be very much grateful ...

Convert number to text
I have a cell with a number in it 1-10 I want to convert that to text like person1 - person10. I have tried all sorts of formula but not quite got there yet. Any ideas fellas? Thanks in advance. Hi, try ="Person"&" "&TRIM(LEFT(F8,FIND("-",F8)-1))&" - "&"Person"&" "&MID(F8,SEARCH("-",F8)+1,3) "Brookyboy" wrote: > I have a cell with a number in it 1-10 > I want to convert that to text like person1 - person10. > I have tried all sorts of formula but not quite got t...

Type Mismatch Error After Converting vbs to wsf
Have a fairly simple vbscript application that was originally coded in a single .vbs file. Includes one function (MJLogTypeIdFromAbbr) that I wanted to move to a common "library" so that I could make it available for use in other vbscript apps. So, I split that function out into a separate .vbs file, and created a wsf file (MJLogTypeId.wsf) that references both the main application (MJLogTypeId.vbs) and the intended function library (MJUtils.vbs). Now when I try to run the application I get Microsoft VBScript runtime error: Type mismatch: 'MJLogTypeIdFromAbbr...

Convert formula to text?
Hi, I have two questions regarding the formula of Excel: 1) When I make a formula appears, i.e. =A2/B2, and the header of A2 is "Mass", and header of B2 is "Volume", is there a way I can make the formula appear as "=Mass/Volume"? 2) Like the above example, but if the value in A2 was 10, the value in B2 was 5, can I make the formula appear as =10/5 ? Thank you very much ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ 1) You can if your ...

Some Cells display text others dates in the same column
I imported a .csv file into Excel. One column contains the SKU # of a product. All my SKU's are formatted as x-xxxx. However some of the cells in the column display the SKU as it should, but many (45 out of 170) are displayed as a date format mmm-yy. Each one of the 45 is different. The cells in question show up as "custom" and when I try to change it to "text" I get a completey different number than the SKU I need. Somebody please help. Hi Phil, Format the entire column manually, choose Format, Cells, Number tab, Custom and enter #-#### in the Type box...