[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Access 2003: Convert date into text

Posted on 2006-06-28
6
Medium Priority
?
232 Views
Last Modified: 2012-06-27
Hi:
I have a field called [ShortDate] which reads a year and month as:  "2006 06" for 2006 June.  I would like to make another field from this one that reads: "2006 June".  I imagine that an amendment to the following query would be easiest.

SELECT tblTFILE_New_TFILE_DateA60504_Converted.KEY, tblTFILE_New_TFILE_DateA60504_Converted.DEPT, tblTFILE_New_TFILE_DateA60504_Converted.REC, tblTFILE_New_TFILE_DateA60504_Converted.NAME, tblTFILE_New_TFILE_DateA60504_Converted.CODE, tblTFILE_New_TFILE_DateA60504_Converted.FDATE_Converted, tblTFILE_New_TFILE_DateA60504_Converted.FDATE, tblTFILE_New_TFILE_DateA60504_Converted.DESC, tblTFILE_New_TFILE_DateA60504_Converted.OP_ID, tblTFILE_New_TFILE_DateA60504_Converted.ShortDate INTO tblTeam3APPOsByOperator
FROM tblTFILE_New_TFILE_DateA60504_Converted
WHERE (((tblTFILE_New_TFILE_DateA60504_Converted.OP_ID) Like "RM" Or (tblTFILE_New_TFILE_DateA60504_Converted.OP_ID) Like "CD" Or (tblTFILE_New_TFILE_DateA60504_Converted.OP_ID) Like "NC"));

Thanks!

Charlie
0
Comment
Question by:cepes
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
6 Comments
 
LVL 65

Expert Comment

by:rockiroads
ID: 17000812
format your date field like this

Format([datefld],"YYYY MMMM")

0
 
LVL 65

Expert Comment

by:rockiroads
ID: 17000827
which field is it u want
0
 
LVL 61

Accepted Solution

by:
mbizup earned 2000 total points
ID: 17000890
It sounds like [ShortDate ] is a string and not a date type?  Give this a try...

SELECT tblTFILE_New_TFILE_DateA60504_Converted.KEY, tblTFILE_New_TFILE_DateA60504_Converted.DEPT, tblTFILE_New_TFILE_DateA60504_Converted.REC, tblTFILE_New_TFILE_DateA60504_Converted.NAME, tblTFILE_New_TFILE_DateA60504_Converted.CODE, tblTFILE_New_TFILE_DateA60504_Converted.FDATE_Converted, tblTFILE_New_TFILE_DateA60504_Converted.FDATE, tblTFILE_New_TFILE_DateA60504_Converted.DESC, tblTFILE_New_TFILE_DateA60504_Converted.OP_ID, tblTFILE_New_TFILE_DateA60504_Converted.ShortDate,
Left( tblTFILE_New_TFILE_DateA60504_Converted.ShortDate,4) & " "  & MonthName( Right(tblTFILE_New_TFILE_DateA60504_Converted.ShortDate,2))  As FormattedShortDate
 INTO tblTeam3APPOsByOperator
FROM tblTFILE_New_TFILE_DateA60504_Converted
WHERE (((tblTFILE_New_TFILE_DateA60504_Converted.OP_ID) Like "RM" Or (tblTFILE_New_TFILE_DateA60504_Converted.OP_ID) Like "CD" Or (tblTFILE_New_TFILE_DateA60504_Converted.OP_ID) Like "NC"));


I added this:
Left( tblTFILE_New_TFILE_DateA60504_Converted.ShortDate,4) & " "  & MonthName( Right(tblTFILE_New_TFILE_DateA60504_Converted.ShortDate,2))  As FormattedShortDate

to convert formats like 2006 06 to 2006 June
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:cepes
ID: 17000892
[ShortDate]
0
 

Author Comment

by:cepes
ID: 17000901
Sorry... just thought of another issue...  If I change to "2006 June" formatting, I lose the sort sequence order of having 2006 06...  I suppose I could sort by ShortDate and make it not visible in the report...

Charlie
0
 
LVL 61

Expert Comment

by:mbizup
ID: 17001164
That would be the best way to go... simpler than working out a sort  on 2006 June etc.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question