A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

extract part of a text value into a date



 
 
Thread Tools Display Modes
  #1  
Old July 17th, 2008, 09:16 PM posted to microsoft.public.access.queries
sherriross81
external usenet poster
 
Posts: 7
Default extract part of a text value into a date

I have a field that is a date but it is stored as a string. I am not allowed
to change the field data type, but in my access report I would like to
display it in more of a readable date format. Right now it displays as
"yyyymmdd". Is there a way to format it so that it is mm/dd/yyyy?

Thanks in advance
  #2  
Old July 17th, 2008, 09:53 PM posted to microsoft.public.access.queries
[email protected]
external usenet poster
 
Posts: 87
Default extract part of a text value into a date

On Jul 17, 1:16*pm, sherriross81
wrote:
I have a field that is a date but it is stored as a string. *I am not allowed
to change the field data type, but in my access report I would like to
display it in more of a readable date format. *Right now it displays as
"yyyymmdd". *Is there a way to format it so that it is mm/dd/yyyy?

Thanks in advance


Does the CDate() function work like this?

SELECT Format( CDate( AnsiInternationalDate ) , "mm/dd/yyyy" )
from MyTable;

Wouldn't that do the trick?
  #3  
Old July 17th, 2008, 10:56 PM posted to microsoft.public.access.queries
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default extract part of a text value into a date

Substitute your field name in the formula below for [y] ---
Format(CVDate(Right(Left([y],6),2) & "/" & Right([y],2) & "/" &
Left([y],4)),"mm/dd/yyyy")
--
KARL DEWEY
Build a little - Test a little


"sherriross81" wrote:

I have a field that is a date but it is stored as a string. I am not allowed
to change the field data type, but in my access report I would like to
display it in more of a readable date format. Right now it displays as
"yyyymmdd". Is there a way to format it so that it is mm/dd/yyyy?

Thanks in advance

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:34 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.