Date format

G

gyom

I am importing contacts information form Act. I need to mention a date in the past.
When imported, the date format is so: 20031128
How do I transform this into Friday, November 28 2003
I tried all I could find on this forum like \@ "d MMMM yyyy" but nothing seems to work.
The format never changed.
Any suggestion?
THanks
Gyom
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?Z3lvbQ==?=,
I am importing contacts information form Act. I need to mention a date in the past.
When imported, the date format is so: 20031128
How do I transform this into Friday, November 28 2003
I tried all I could find on this forum like \@ "d MMMM yyyy" but nothing seems to work.
The format never changed.
Word won't recognize this as a date, and it has no string manipulation functions that
could pull this apart, so this could get a bit tricky. I'd try setting up a set of
nested fields along these lines:

{ Quote "{ = { Mergefield Date } \# "0000'-'00'-'00" }" \@ "MMMM d, yyyy" }

Pay special attention to the "quotes" and 'apostrophes'

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow question or reply in the
newsgroup and not by e-mail :)
 
M

macropod

Hi gyom,

If your imported date is always 8 characters long, you could use the
following compound field to convert it into the "Friday, November 28, 2003"
day/date format:

{QUOTE
{SET Data 20031128}
{SET d{=MOD(Data,100)}}
{SET m{=INT(MOD(Data,10000)/100)}}
{SET y{=INT(Data/10000)}}
{SET
jd{=INT(365.25*(y+4799+INT((m+10)/12)))+INT(367/12*MOD(m+10,12))-INT(3*INT((
y+4901+INT((m+10)/12))/100)/4)+d-32075}}
{SET c{=jd+68569-INT(36524.25*INT((jd+68569)/36524.25)+0.75)}}
{SET f{=c-INT(365.25*INT((c+1)/365.25025))+31}}
{SET dd{=f-INT(30.58757*INT(f/30.58757))}}
{SET mm"{=INT(f/30.58757)+2-12*INT(INT(f/30.58757)/11)}/00"}
{SET
yy{=100*(INT((jd+68569)/36524.25)-49)+INT((c+1)/365.25025)+INT(INT(f/30.5875
7)/11)}}
{IF{=MOD(jd,7)}= 0 Mon {IF{=MOD(jd,7)}= 1 Tues {IF{=MOD(jd,7)}= 2 Wednes
{IF{=MOD(jd,7)}= 3 Thurs {IF{=MOD(jd,7)}= 4 Fri {IF{=MOD(jd,7)}= 5 Satur
Sun}}}}}}day
44 160{mm \@ MMM}160{dd}44 160{yy}}

Yes, it's all one field - I've just broken it into logical segments to
improve readability. Most of the effort goes into converting the date into a
Julian day number from which you can extract the weekday.

Cheers
 
C

Cindy M -WordMVP-

Hi Macropod,
If your imported date is always 8 characters long, you could use the
following compound field to convert it into the "Friday, November 28, 2003"
day/date format:
Why so complicated :)? Have you found some problems with how the single
Quote field I proposed works?

Cindy Meister
 
M

macropod

Hi Cindy,

As I said in my post, most of the complication is to do with extracting the
day of the week, as per the original request, which I don't believe to be
possible otherwise.

Cheers
PS: I Should have had an extra 'M' in the final month switch, too, to return
the full month name instead of the abbreviated version.
 
M

macropod

Actually, forget my last post too - I've just realised that the same result
could have been achived by changing the date switch in your field to:
"dddd, MMMM d, yyyy"

DOH!!!

Cheers
 
C

Cindy M -WordMVP-

Hi Macropod,
Actually, forget my last post too - I've just realised that the same result
could have been achived by changing the date switch in your field to:
"dddd, MMMM d, yyyy"
<BG>

Cindy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Publisher is filling blank lines with data 2
Date Formats 4
How to add day to PWA 2016 date format? 0
Dates Challenge 0
International Date formatting 6
date toggle not toggling 2
Date Format 1
Remove date format? 3

Top