DATABASE FIELD and Date format

G

GIG

I try to import my old data base to Word document (Microsoft Office XP) with help of DATABASE field. It properly works but the database fields of date type are always transferred with the american date format like "11/23/03". Unfortunately I need an another one. I changed the format everywhere I knew something was to change: operating system, MS Word adjustements. Unfortunately it didn't affect the imported data. I don't know as well why the switching date format command: \@ * has no effect in DATABASE field. This is my problem. Do You know, friends, how make it

Krystian
 
M

macropod

Hi Krystian,

In you Word mailmerge document, edit the date mergefield
(using the date switches) to look like:
{MERGEFIELD date \@ "dd/MM/yy"}
or
{MERGEFIELD date \@ "dd-MMM-yyyy"}
or
{MERGEFIELD date \@ "dd MMMM yyyy"}
etc, according to your preferred output format.

You can see the field formats by selecting them and
pressing Shift-F9. Press F9 after editing to update the
displayed result.

Cheers

-----Original Message-----
I try to import my old data base to Word document
(Microsoft Office XP) with help of DATABASE field. It
properly works but the database fields of date type are
always transferred with the american date format
like "11/23/03". Unfortunately I need an another one. I
changed the format everywhere I knew something was to
change: operating system, MS Word adjustements.
Unfortunately it didn't affect the imported data. I don't
know as well why the switching date format command: \@ *
has no effect in DATABASE field. This is my problem. Do
You know, friends, how make it?
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?R0lH?=,
I try to import my old data base to Word document (Microsoft Office XP) with help of DATABASE field. It properly works but the database fields of date type are always transferred with the american date format like "11/23/03". Unfortunately I need an another one. I changed the format everywhere I knew something was to change: operating system, MS Word adjustements. Unfortunately it didn't affect the imported data. I don't know as well why the switching date format command: \@ * has no effect in DATABASE field. This is my problem.
What is the database program you're importing from? Does it have a query interface? Or can you access it via MS Query (an ODBC driver)?

Are you able to link it into Excel?

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 :)
 
D

DATABASE FORMAT

Hi

Thank You for response. My formula in MS Word XP is as follow

{DATABASE \d "C:\\DOSES\\Dose.dbf" \c "DSN=dBASE Files;DBQ=C:\\DOSES;DefaultDir=C:\\DOSES;DriverId=277;FIL=dBase IV;MaxBufferSize=2048;PageTimeout=600;" \s "SELECT `REPORT`, `PLACE`, `HEAT_DATE`,`TOTAL_DOSE` FROM Dose.dbf WHERE ((`PERSON` IS NULL OR `PERSON` IS NOT NULL ))" \l "16" \b "21"

Where Dose.dbf is the name of my old database and `REPORT`, `PLACE`, `HEAT_DATE`,`TOTAL_DOSE` are the chosen field names of this database. One of these fields: 'Heat_Date' is date type and I can't receive the appropriate format. According to Your advice I tried to use command MERGEFIELD (e.g. MERGEFIELD 'HEAT_DATE' \@ "dd.MM.yyyy") in any combination to make it but this unfortunately doesn't affect within the command DATABASE. I know it could be resolved by including of Excel but I'm a bit stubborn and keep trying to make it simpler

thanks,greetin
Krystian
 
D

DATABASE Format

Hi Cindy

It's my formula

DATABASE \d "C:\\DOSES\\Dose.dbf" \c "DSN=dBASE Files;DBQ=C:\\DOSES;DefaultDir=C:\\DOSES;DriverId=277;FIL=dBase IV;MaxBufferSize=2048;PageTimeout=600;" \s "SELECT `REPORT`, `PLACE`, `HEAT_DATE`,`TOTAL_DOSE` FROM Dose.dbf WHERE ((`PERSON` IS NULL OR `PERSON` IS NOT NULL ))" \l "16" \b "21

where dose.dbf is data base name and `REPORT`, `PLACE`, `HEAT_DATE`,`TOTAL_DOSE are the chosen fields I want to transfer into MS word document. The 'HEAT_DATE' is a field of date type that is transferred as an US date format what is not accepted in my country. So I try to improve it. It's very surprising that the switch command like: fieldname\@ "dd.MM.yyyy" dosn't affect this format. Yes, of course I can reach this database by Excel but why is it not possible to make it within MS Word XP. In the MS Word 97, I simply didn't have such problems

Thank You Cindy

Krystian
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?REFUQUJBU0UgRm9ybWF0?=,

Thanks for the additional information. No guarantees on this, but if everything
works as I hope, you should be able to do this by extending the SELECT statement
that's bringing in the data. Something like this:

\s "SELECT `REPORT`, `PLACE`, Format(`HEAT_DATE`, 'dd.MM.yyyy') AS 'Heat
Date',`TOTAL_DOSE` FROM Dose.dbf WHERE ((`PERSON` IS NULL OR `PERSON` IS NOT NULL
))"

Note that Word is very finicky about the type of quotes and apostrophes, so the
above suggestion may not work as it stands. If you're using MSQuery to link the
data in (looks like you may be?), then I'd try setting this up in the MSQuery SQL
view and let the software worry about "translating" the SQL to something Word
understands. Please note that I'm also not certain whether the dBASE ODBC driver
knows how to work with the Format function. This will work with Access and Excel.
You may need to contact someone who's intimately acquainted with dBase to find
out if they have an equivalent function that's also supported by the ODBC driver.
DATABASE \d "C:\\DOSES\\Dose.dbf" \c "DSN=dBASE
Files;DBQ=C:\\DOSES;DefaultDir=C:\\DOSES;DriverId=277;FIL=dBase
IV;MaxBufferSize=2048;PageTimeout=600;" \s "SELECT `REPORT`, `PLACE`,
`HEAT_DATE`,`TOTAL_DOSE` FROM Dose.dbf WHERE ((`PERSON` IS NULL OR `PERSON` IS
NOT NULL ))" \l "16" \b "21"
where dose.dbf is data base name and `REPORT`, `PLACE`, `HEAT_DATE`,`TOTAL_DOSE
are the chosen fields I want to transfer into MS word document. The 'HEAT_DATE'
is a field of date type that is transferred as an US date format what is not
accepted in my country. So I try to improve it. It's very surprising that the
switch command like: fieldname\@ "dd.MM.yyyy" dosn't affect this format. Yes, of
course I can reach this database by Excel but why is it not possible to make it
within MS Word XP. In the MS Word 97, I simply didn't have such problems.
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 :)
 
G

GIG, Katowice

Hi Cindy

You are brilliant! It really works! This will spare me a lot of work. Thank You

Krystian
 
G

GIG, Katowice

Cindy, one more question,

If I try to join two fields,let's say 'TOTAL_DOSE' and 'ERR_DOSE, and put a sign between: a Word symbol sign "plus/minus" - sign code 177, how should I deal with it (I tried it with the command: SYMBOL 177 \* MERGEFORMAT but without success):

'TOTAL_DOSE'+'?????'+'ERR_DOSE' ?

Forgive me I take Your time,

Krystian
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?R0lHLCBLYXRvd2ljZQ==?=,
If I try to join two fields,let's say 'TOTAL_DOSE' and 'ERR_DOSE, and put a
sign between: a Word symbol sign "plus/minus" - sign code 177, how should I
deal with it (I tried it with the command: SYMBOL 177 \* MERGEFORMAT but
without success):
'TOTAL_DOSE'+'?????'+'ERR_DOSE' ?
Again, no guarantees, but the basic approach would be similar:

\s "SELECT `REPORT`, `PLACE`, Format(`HEAT_DATE`, 'dd.MM.yyyy') AS 'Heat
Date', (TOTAL_DOSE) AS 'Total Dose +- ErrDose' FROM Dose.dbf WHERE ((`PERSON`
IS NULL OR `PERSON` IS NOT NULL
))"

For the +- try holding down the ALT key while typing 0177 on the numeric
keypad, at the right of the keyboard.

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 :)
 
G

GIG, Katowice

Hi Cindy,

One more thank You!

With Your help I manged to resolve all my problems. My full command is now as follow:

(...) FORMAT(`HEAT_DATE`,'dd.MM.yyyy'),`TOTAL_DOSE` + '±' +`ERR_DOSE`

and it perfectly works. The sign ± I had to introduce, as you had said, by putting on (left ALT) key while typing 0177 number code of this sign on the numeric keypad.

greetings,

Krystian
 

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

Top