Solved

Access 2003: Convert date into text

Posted on 2006-06-28
6
219 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 500 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
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 

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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

732 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