convert date field to month/year

Hello,

I have a table with a date field. In query, I would like to convert the date 
field like mm/dd/yyyy to just the year and month. what function do I put to 
achieve this? 

PS. if the format is yy-mmm (08-APR, 08-JAN), when I export the data to 
Excel, I need it to recognize the date so when it sort, the 08-JAN goes 
before 08-APR. Thanks
1
Utf
2/21/2008 2:56:01 PM
access.queries 6343 articles. 1 followers. Follow

1 Replies
7729 Views

Similar Articles

[PageSpeed] 12

Then you need the day, 1, for the day, if you want to SORT on real dates.


    DateValue(myDate+1 -DatePart("d", myDate))


transform the date, pushing it to the first day of the same month, same 
year.


    For your report, you can FORMAT it with  yy-mmm:


?  Format( now, "yy-mmm" )
08-Feb

? DateValue(now +1 -DatePart("d", now))
2008.02.01         ' if you type the previous expression while in the month 
of February 2008
                            ' my default format, for date, is the ISO double 
dot format:  yyyy.mm.dd




Vanderghast, Access MVP


"Cam" <Cam@discussions.microsoft.com> wrote in message 
news:E02711C3-6031-47AE-A0C9-31C52DE0CB14@microsoft.com...
> Hello,
>
> I have a table with a date field. In query, I would like to convert the 
> date
> field like mm/dd/yyyy to just the year and month. what function do I put 
> to
> achieve this?
>
> PS. if the format is yy-mmm (08-APR, 08-JAN), when I export the data to
> Excel, I need it to recognize the date so when it sort, the 08-JAN goes
> before 08-APR. Thanks 


0
Michel
2/21/2008 3:04:54 PM
Reply:

Similar Artilces:

Convert text to time value
I have a series of time values in a 'General' format. They are of the type: 184525 Which is 18:45:25 or 6:45:25 pm. A time which is am would be of the type: 12345 Which is 1:23:45 am. Is there a way to convert those 'General' values to an Excel serial so that I can figure out the difference between two times? I've seen a bunch of examples on the net, but none of those that I have found deal with this format that I can tell. Thanks. Hi try =--TEXT(A1,"00:00:00") -- Regards Frank Kabel Frankfurt, Germany "Andy" <amelton@gmail.com> schrieb...

how to convert date
Hi, I'm looking for some method to convert mail date, in format: eg. "Sun, 18 Sep 2005 20:57:08 +0200", to computer local time. I tried CTime but without resoults. m. Have you tried COleDateTime::ParseDateTime()? m.wski21.usunto@aust.com wrote: > Hi, > > I'm looking for some method to convert mail date, in format: > eg. "Sun, 18 Sep 2005 20:57:08 +0200", to computer local time. > I tried CTime but without resoults. > > m. >I'm looking for some method to convert mail date, in format: >eg. "Sun, 18 Sep 2005 20:57:08 +0200&qu...

Odd date problem
I'm reposting this as this is a very strange problem in Access. I'm using 2003. After my entry is an entry by missinglinq via AccessMonster.com who was able to reproduce the error. Looking forward to comments/fixes. Thanks, Rob I have the following in the DblClick event for the control CaseStart which is a date/time field. The problem is that once the control is double clicked the form remains in edit mode, even though I've told it not be editable. Additionally, when the control is double clicked, it shoudn't enter in the time until the Edit button has been clicked o...

largest value of field in query output
I have a query that pulls all the records from a table. For example, the query outputs the following: TITLE REV POSITION DATE methodA / 0 / tech / july 5 methodA / 1 / tech / july 10 methodB / 0 / tech / july 5 methodB / 1 / tech / july 10 methodB / 2 / tech / july 12 methodC / 0 / tech / july 6 methodC / 1 / ...

How to Convert UTC to localTIme(C# )
I have got the value of user account's lastlogon time. Its type is Int64. This value is stored as a large integer that represents the number of 100 nanosecond intervals since January 1, 1601 (UTC)(Refer to MSDN). I don't know how to convert this value to localTime. The following is my code. ################################################################ DirectoryEntry deUser = new DirectoryEntry(ldappath); DirectorySearcher src = new DirectorySearcher(deUser); src.Filter = "(&(objectClass=user)(SAMAccountName=" + accountNa...

SUM a range based on month
I need to SUM a range of cells only if it is in a certain month. =SUMIF(sheet1!A4:A10000,">="&DATE(2004,2,1),values) This formula sums all months from Feb 1 on. I only want February. Is there a way to enter the end date in my formula? I need to do this for every month. Joe =SUMPRODUCT(--(TEXT(Sheet1!A4:A10000,"mmm")="Feb")) HTH Jason Atlanta, GA >-----Original Message----- >I need to SUM a range of cells only if it is in a certain month. > >=SUMIF(sheet1!A4:A10000,">="&DATE(2004,2,1),values) > >This formula su...

creating custom fields for contacts
I want to create custom fields in the 'details' section of contacts. I was able to create a new section but when select the 'Add Fields' I can only choose from the fields created by Microsoft. Ideally I would like to be able to create a custom field and determine if it needed a pull-down or user entry or user selected (like a simple yes/no) Is this possible? Thanks Rob Jayson Hi Rob, It is very easy to create custom fields and include them in existing forms. You can create new fields or attributes as they are called, by clicking on Settings->Customization-> ...

How do I convert dates to text keeping the format?
I'm trying to convert a column of data in date format *m/d/yyyy to a text format without converting to serial numbers. Ie: I want to retain the mm/dd/yyyy format. Is there a way to do this? =TEXT(A1,"MM/DD"/YYYY") "sprlarry" <sprlarry@discussions.microsoft.com> wrote in message news:69669AA6-FD15-47D7-843D-FC768728BF7A@microsoft.com... > I'm trying to convert a column of data in date format *m/d/yyyy to a text > format without converting to serial numbers. Ie: I want to retain the > mm/dd/yyyy format. Is there a way to do this? That ...

Excel: Auto converting text to numbers
I am downloading an Excel sheet, and the numbers come in as text. It basically comes in as "33 %" but Excel registers this as text, not a percentage. I have a cell that will be used to add the numbers, but since they are text it doesn't work. Given this information, is there a way to convert the imported data into numbers. I would prefer to include this into my formula. The potential numbers are: 0, 1, 2, 3, 4, 0 %, 25 %, 33 %, 50 %, 67 %, 75 %, 100 %, and N/A I would prefer a function, again if possible, that could convert any number. Please note, the space between the nu...

Unintended field "expression 1006" in the query grids
Hello, When I open my query, there is an unintended field "Expr 1006". I do not know why is this automatically created. Anyone tells me, why this happened. -- H. Frank Situmorang Hi Frank this usually means that you put the same field into the query twice. Jeanette Cunningham "Frank Situmorang" <hfsitumo2001@yahoo.com> wrote in message news:2CF86F30-0E4D-499B-9FE0-D62BF450BC57@microsoft.com... > Hello, > > When I open my query, there is an unintended field "Expr 1006". I do not > know why is this automatically created. Anyone tells me, w...

how to convert excel's .cvf file to .csv file
...

Can I use the value of a field as predeterminate value of another.
I am making a table to know who is working in each surgery in a heath center. For each day, I have a field "owner" (of the surgery) and another "working" (the one that really works that day there). But the majority of the days, the "owner" is who works in his surgery, so I want to establish the value of "owner" as predeterminate value of "working" . Is it possible? Thank you Not directly in the tables. You could do this in a form by making the value of one text box the default value of another text box. -- --Roger Carlson MS Access M...

Convert Access97 to 2000
Hello, we're currently running access97 and would like to convert it to 2000, but we don't know what is the administrator password for this database. Also this database is running on multi user and have difference permission for diffence users. Could someone help me how to do make this happen but keep the currently permission retaint. Thanks ...

Dates not correct
How do I get my DateDif output to reflect the correct 30 days in a month. Im getting 49 days, it should be pulled to the months and 19 days in days. 2 years, 11 months, 49 days See this for examples: http://cpearson.com/excel/datedif.htm Biff <belczyk@gmail.com> wrote in message news:1177357276.085439.98020@e65g2000hsc.googlegroups.com... > How do I get my DateDif output to reflect the correct 30 days in a > month. Im getting 49 days, it should be pulled to the months and 19 > days in days. > > > 2 years, 11 months, 49 days > ...

Add help text to a form field?
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) I'd like to give people instructions about how to fill in form fields in the form itself. I tried &quot;adding help text,&quot; but nothing shows up in the form field. Is what I am trying to do possible, and, if so, what am I doing wrong? What you're using appears in the Status Bar when the field is accessed. Unless people know to look there it does practically no good. IMHO it's more effective to include instructional text as default content for the field or provide explicit labeling in an adjacent table c...

Convert 2000 Calendar to web page
Greetings, When I convert my calendar for 2005 to a webpage, the page is off by 1 day. Is there a template or fix available to fix this? Thanks, Duane I can edit the html file but this should not be the case. Fixes? Suggestions...other than use Apple? "Duane Perry" <dlp_sr@yahoo.com> wrote in message news:yZRtd.5561$0r.1710@newsread1.news.pas.earthlink.net... > Greetings, > > When I convert my calendar for 2005 to a webpage, the page is off by 1 day. > Is there a template or fix available to fix this? > > Thanks, > > Duane > > Duane, ...

Outbox displays Received Date
Need some help on this one. I'm using Outlook 2000 on a Windows XP machine and for some odd reason the Outbox now displays the "Received" date and the Inbox displays the "Sent" date. How do i correct this. It seems to be hidden in the PST file because when I login on a different machine it shows the same thing. Right click on the column headers and choose the "Field Chooser". Drag the field you want to see from the Field Chooser into the column headers area. Drag column headers you don't want to see away from the column headers. "Lee" ...

Invoice Due Date #2
Hello, I'm using Money Small Business 2006 and need some help. How can I specify the due date on a invoice? It seems to automatically use the date that the invoice is created on. All help appreciated. Thank you. > How can I specify the due date on a invoice? It seems to automatically > use the date that the invoice is created on. Below the Line Item table there is a link "To add or edit billing and shipping addresses, notes, or other information, go to the Invoice Details". Click that link and you can specify the Payment Terms. I don't see where to specify a cet...

Memo Fields
I'm trying to collect data for a multiple record update and place it into a memo field. The application steps through a record set compiling the data to a text box on a form while not eor Me![Text1] = Me![Text1] & ", " & Me![RecordData] Wend This works fine. When I look at Me![Text1] after the While loop all the data is correct. I then place this filed into a table using a simple append query, but when I look in the table the information is truncated with many non-alpha charaters at the end. Any thoughts? On Tue, 26 Feb 2008 08:54:01 -0800, Justin <Justin...

XML Note convert to DataSet
Hello, I have this function: object acmResponse = acmLogin.acmString("4001", "", paramFormLogin + paramUserBasics);System.Xml.XmlNode[] acmNodes = (System.Xml.XmlNode[])acmResponse; What I have todo, to convert the XML Object in the DataSet Object? Thank you Matthias ...

Convert
Is it possible to convert a Money file created in the USA version to that of the UK version? Thanks in advance The general way is QIF Export then Import. It's involved and has limitations like loan accounts don't QIF. See http://www.bollar.org/msmoney/#Q1. "Crispy" <nowayspammers@hotmail.com> wrote in message news:uQKSfzfyDHA.2500@TK2MSFTNGP09.phx.gbl... > Is it possible to convert a Money file created in the USA version to that of > the UK version? ...

Problem converting from Quicken to M2005
My Quicken files are mostly investment related, and generally converted fine. However all bonds (regular and muni's) converted as Investment type: Mutual Fund, not Bond. (1) How do I prevent that, (2) How do you change the Investment Type for an item? Thank you. In microsoft.public.money, Mike wrote: >My Quicken files are mostly investment related, and generally >converted fine. However all bonds (regular and muni's) converted as >Investment type: Mutual Fund, not Bond. (1) How do I prevent that, (2) Money typically converts custom data types from Quicken into funds. I thou...

Number of hrs worked in a week, based on dates in a different column
Hi. I'm hoping someone will give this a try. I'd like to enter a function into each cell in column D so that the total hours worked for the previous week appears each Sunday. For instance, cell D6 would display 11, the sum of C2:C6 (note this is a short week). Cell D20 would display 22.5, the sum of C7:C20. On some days, no work at all is performed, but on other days multiple tasks are performed. The only cells in column D that should display a value are the Sunday's... all other cells should display nothing. Thanks very much for your help!! Gregg. ...

max number of fields on a form (new question)
I am creating a database based on a paper form. The paper form has over 360 individual pieces of information, all of which are recorded for research purposes. My boss would like me to create a replica electronic form based on the paper form, but access only allows 255 fields on one form. Other than subforms, is there any other way to get around this? I have my data organized into related tables, but every field from each table needs to be on the form. Any suggestions? The limit of 255 is not the form. Forms have a lifetime limit of 754 controls. That means that if you delete a control the...

Numbers converting to decimal
I a trying to figure out why when I type 11 and automatically converts it to .11, if I type 11. it will stay 11,if I change all the cells to text then back to number they willstay. I have checked the formatting of the cells, it even happens when I open a brand new worksheet. Any ideas? Thanks Dawn Hi Dawn, Tools>Option>Edit, uncheck Fixed Decimal -- Kind Regards, Niek Otten Microsoft MVP - Excel "DawnP" <anonymous@discussions.microsoft.com> wrote in message news:c3cf01c48a05$d75359d0$a501280a@phx.gbl... > I a trying to figure out why when I type 11 and &...