Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
GCNY GCNY is offline
external usenet poster
 
Posts: 5
Default Scientific format

I have an Access 2003 database where some of the number fields are in
scientific format.

In Word 2003 when I insert the scientific formatted fields, they appear in
decimal format.

How can I handle this formatting problem?
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Scientific format

The following was posted by fellow MVP Macropod:

Quote

The following compound field will return the scientific notation of any +ve
value between 10^-9 and 10^9:
{QUOTE
{SET a {SourceVal}}
{SET
b{=9-(a10^9)-(a10^8)-(a10^7)-(a10^6)-(a10^5)-(a10^4)-(a10^3)-(a10^2)
-(a10^1)-(a10^0)-(a10^-1)-(a10^-2)-(a10^-3)-(a10^-4)-(a10^-5)-(a10^-
6)-(a10^-7)-(a10^-8)}}
{SET c{=int(a/10^b)+mod(a,10^b)/10^b}}
{c \# 0.00}E{b \# +00;-00}}
where 'SourceVal' is the input, which could be a formula taking its input
from two formfields. You can extend the range easily enough by adding more
terms.

All the field braces (i.e. { }) are created in pairs via Ctrl-F9. I've laid
the coding out with line breaks to separate the key portions of the coding,
but you don't really need them.

Unquote

I am not sure if this will work with mailmerge, but I think that the thing
to do would be to replace

{SourceVal}

with your Merge Field that contains the value.
--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"GCNY" wrote in message
...
I have an Access 2003 database where some of the number fields are in
scientific format.

In Word 2003 when I insert the scientific formatted fields, they appear in
decimal format.

How can I handle this formatting problem?



  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
GCNY GCNY is offline
external usenet poster
 
Posts: 5
Default Scientific format

Thank you for the response. I will try it.

In a QBE form do I set up an expression and enter this code after the colon?

"Doug Robbins - Word MVP" wrote:

The following was posted by fellow MVP Macropod:

Quote

The following compound field will return the scientific notation of any +ve
value between 10^-9 and 10^9:
{QUOTE
{SET a {SourceVal}}
{SET
b{=9-(a10^9)-(a10^8)-(a10^7)-(a10^6)-(a10^5)-(a10^4)-(a10^3)-(a10^2)
-(a10^1)-(a10^0)-(a10^-1)-(a10^-2)-(a10^-3)-(a10^-4)-(a10^-5)-(a10^-
6)-(a10^-7)-(a10^-8)}}
{SET c{=int(a/10^b)+mod(a,10^b)/10^b}}
{c \# 0.00}E{b \# +00;-00}}
where 'SourceVal' is the input, which could be a formula taking its input
from two formfields. You can extend the range easily enough by adding more
terms.

All the field braces (i.e. { }) are created in pairs via Ctrl-F9. I've laid
the coding out with line breaks to separate the key portions of the coding,
but you don't really need them.

Unquote

I am not sure if this will work with mailmerge, but I think that the thing
to do would be to replace

{SourceVal}

with your Merge Field that contains the value.
--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"GCNY" wrote in message
...
I have an Access 2003 database where some of the number fields are in
scientific format.

In Word 2003 when I insert the scientific formatted fields, they appear in
decimal format.

How can I handle this formatting problem?




  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
GCNY GCNY is offline
external usenet poster
 
Posts: 5
Default Scientific format

Dear Doug:

In an Access QBE form I set up an Expression: followed by the {QUOTE......}}
below.

I got an error message saying: Replication ID is invalid. Replication ID
must contain digits, letters, or hexadecimal numbers and must of the right
length and be in canonicalSQL form.

I have no idea what any ot that means, except perhaps using {, (, #, etc.
characters might be a problem.

Do you have any further suggestions?

Thank you.

Steve Barker
------------------------
"Doug Robbins - Word MVP" wrote:

The following was posted by fellow MVP Macropod:

Quote

The following compound field will return the scientific notation of any +ve
value between 10^-9 and 10^9:
{QUOTE
{SET a {SourceVal}}
{SET
b{=9-(a10^9)-(a10^8)-(a10^7)-(a10^6)-(a10^5)-(a10^4)-(a10^3)-(a10^2)
-(a10^1)-(a10^0)-(a10^-1)-(a10^-2)-(a10^-3)-(a10^-4)-(a10^-5)-(a10^-
6)-(a10^-7)-(a10^-8)}}
{SET c{=int(a/10^b)+mod(a,10^b)/10^b}}
{c \# 0.00}E{b \# +00;-00}}
where 'SourceVal' is the input, which could be a formula taking its input
from two formfields. You can extend the range easily enough by adding more
terms.

All the field braces (i.e. { }) are created in pairs via Ctrl-F9. I've laid
the coding out with line breaks to separate the key portions of the coding,
but you don't really need them.

Unquote

I am not sure if this will work with mailmerge, but I think that the thing
to do would be to replace

{SourceVal}

with your Merge Field that contains the value.
--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"GCNY" wrote in message
...
I have an Access 2003 database where some of the number fields are in
scientific format.

In Word 2003 when I insert the scientific formatted fields, they appear in
decimal format.

How can I handle this formatting problem?




  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Scientific format

In your duplicate thread in another forum (please don't multipost!) I
replied - From the Tools menu in Word, select Options and then go to the
General tab and check the box against the "Confirm conversions at open"
item. Then when you attach the data source to the mail merge main document,
you will be given the option of using the DDE method of connection which
should read the data as you have it formatted in the table.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


GCNY wrote:
Dear Doug:

In an Access QBE form I set up an Expression: followed by the
{QUOTE......}} below.

I got an error message saying: Replication ID is invalid.
Replication ID must contain digits, letters, or hexadecimal numbers
and must of the right length and be in canonicalSQL form.

I have no idea what any ot that means, except perhaps using {, (, #,
etc. characters might be a problem.

Do you have any further suggestions?

Thank you.

Steve Barker
------------------------
"Doug Robbins - Word MVP" wrote:

The following was posted by fellow MVP Macropod:

Quote

The following compound field will return the scientific notation of
any +ve value between 10^-9 and 10^9:
{QUOTE
{SET a {SourceVal}}
{SET
b{=9-(a10^9)-(a10^8)-(a10^7)-(a10^6)-(a10^5)-(a10^4)-(a10^3)-(a10^2)
-(a10^1)-(a10^0)-(a10^-1)-(a10^-2)-(a10^-3)-(a10^-4)-(a10^-5)-(a10^-
6)-(a10^-7)-(a10^-8)}}
{SET c{=int(a/10^b)+mod(a,10^b)/10^b}}
{c \# 0.00}E{b \# +00;-00}}
where 'SourceVal' is the input, which could be a formula taking its
input from two formfields. You can extend the range easily enough by
adding more terms.

All the field braces (i.e. { }) are created in pairs via Ctrl-F9.
I've laid the coding out with line breaks to separate the key
portions of the coding, but you don't really need them.

Unquote

I am not sure if this will work with mailmerge, but I think that the
thing to do would be to replace

{SourceVal}

with your Merge Field that contains the value.
--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"GCNY" wrote in message
...
I have an Access 2003 database where some of the number fields are
in scientific format.

In Word 2003 when I insert the scientific formatted fields, they
appear in decimal format.

How can I handle this formatting problem?





  #6   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Scientific format

No, you would put the expression in the mail merge main document.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"GCNY" wrote in message
news
Thank you for the response. I will try it.

In a QBE form do I set up an expression and enter this code after the
colon?

"Doug Robbins - Word MVP" wrote:

The following was posted by fellow MVP Macropod:

Quote

The following compound field will return the scientific notation of any
+ve
value between 10^-9 and 10^9:
{QUOTE
{SET a {SourceVal}}
{SET
b{=9-(a10^9)-(a10^8)-(a10^7)-(a10^6)-(a10^5)-(a10^4)-(a10^3)-(a10^2)
-(a10^1)-(a10^0)-(a10^-1)-(a10^-2)-(a10^-3)-(a10^-4)-(a10^-5)-(a10^-
6)-(a10^-7)-(a10^-8)}}
{SET c{=int(a/10^b)+mod(a,10^b)/10^b}}
{c \# 0.00}E{b \# +00;-00}}
where 'SourceVal' is the input, which could be a formula taking its input
from two formfields. You can extend the range easily enough by adding
more
terms.

All the field braces (i.e. { }) are created in pairs via Ctrl-F9. I've
laid
the coding out with line breaks to separate the key portions of the
coding,
but you don't really need them.

Unquote

I am not sure if this will work with mailmerge, but I think that the
thing
to do would be to replace

{SourceVal}

with your Merge Field that contains the value.
--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"GCNY" wrote in message
...
I have an Access 2003 database where some of the number fields are in
scientific format.

In Word 2003 when I insert the scientific formatted fields, they appear
in
decimal format.

How can I handle this formatting problem?






  #7   Report Post  
Posted to microsoft.public.word.mailmerge.fields
GCNY GCNY is offline
external usenet poster
 
Posts: 5
Default Scientific format

Excuse me for multiposting; but this problem involves both Word & Access. I
don't know where the answer will come from.

The Tools/Options/General/Confirm conversions at open was checked. So that
is not the solution.

"Graham Mayor" wrote:

In your duplicate thread in another forum (please don't multipost!) I
replied - From the Tools menu in Word, select Options and then go to the
General tab and check the box against the "Confirm conversions at open"
item. Then when you attach the data source to the mail merge main document,
you will be given the option of using the DDE method of connection which
should read the data as you have it formatted in the table.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


GCNY wrote:
Dear Doug:

In an Access QBE form I set up an Expression: followed by the
{QUOTE......}} below.

I got an error message saying: Replication ID is invalid.
Replication ID must contain digits, letters, or hexadecimal numbers
and must of the right length and be in canonicalSQL form.

I have no idea what any ot that means, except perhaps using {, (, #,
etc. characters might be a problem.

Do you have any further suggestions?

Thank you.

Steve Barker
------------------------
"Doug Robbins - Word MVP" wrote:

The following was posted by fellow MVP Macropod:

Quote

The following compound field will return the scientific notation of
any +ve value between 10^-9 and 10^9:
{QUOTE
{SET a {SourceVal}}
{SET
b{=9-(a10^9)-(a10^8)-(a10^7)-(a10^6)-(a10^5)-(a10^4)-(a10^3)-(a10^2)
-(a10^1)-(a10^0)-(a10^-1)-(a10^-2)-(a10^-3)-(a10^-4)-(a10^-5)-(a10^-
6)-(a10^-7)-(a10^-8)}}
{SET c{=int(a/10^b)+mod(a,10^b)/10^b}}
{c \# 0.00}E{b \# +00;-00}}
where 'SourceVal' is the input, which could be a formula taking its
input from two formfields. You can extend the range easily enough by
adding more terms.

All the field braces (i.e. { }) are created in pairs via Ctrl-F9.
I've laid the coding out with line breaks to separate the key
portions of the coding, but you don't really need them.

Unquote

I am not sure if this will work with mailmerge, but I think that the
thing to do would be to replace

{SourceVal}

with your Merge Field that contains the value.
--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"GCNY" wrote in message
...
I have an Access 2003 database where some of the number fields are
in scientific format.

In Word 2003 when I insert the scientific formatted fields, they
appear in decimal format.

How can I handle this formatting problem?




  #8   Report Post  
Posted to microsoft.public.word.mailmerge.fields
GCNY GCNY is offline
external usenet poster
 
Posts: 5
Default Scientific format

Where? As a macro for each of the 8 Scientific format merge fileds or just
once?

"Doug Robbins - Word MVP" wrote:

No, you would put the expression in the mail merge main document.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"GCNY" wrote in message
news
Thank you for the response. I will try it.

In a QBE form do I set up an expression and enter this code after the
colon?

"Doug Robbins - Word MVP" wrote:

The following was posted by fellow MVP Macropod:

Quote

The following compound field will return the scientific notation of any
+ve
value between 10^-9 and 10^9:
{QUOTE
{SET a {SourceVal}}
{SET
b{=9-(a10^9)-(a10^8)-(a10^7)-(a10^6)-(a10^5)-(a10^4)-(a10^3)-(a10^2)
-(a10^1)-(a10^0)-(a10^-1)-(a10^-2)-(a10^-3)-(a10^-4)-(a10^-5)-(a10^-
6)-(a10^-7)-(a10^-8)}}
{SET c{=int(a/10^b)+mod(a,10^b)/10^b}}
{c \# 0.00}E{b \# +00;-00}}
where 'SourceVal' is the input, which could be a formula taking its input
from two formfields. You can extend the range easily enough by adding
more
terms.

All the field braces (i.e. { }) are created in pairs via Ctrl-F9. I've
laid
the coding out with line breaks to separate the key portions of the
coding,
but you don't really need them.

Unquote

I am not sure if this will work with mailmerge, but I think that the
thing
to do would be to replace

{SourceVal}

with your Merge Field that contains the value.
--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"GCNY" wrote in message
...
I have an Access 2003 database where some of the number fields are in
scientific format.

In Word 2003 when I insert the scientific formatted fields, they appear
in
decimal format.

How can I handle this formatting problem?






  #9   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Scientific format

You would have to repeat the fields for each number you want to present.
i.e., the only mechanism in the field language for code re-use is copying
the code.

Another approach would be to create a query in Access that returns
format(myfield,'Scientific') for each number in scientific format, then use
that as the data source for your merge - e.g.

SELECT *, format(myfield1,'Scientific') as [myfield1s],
format(myfield2,'Scientific') as [myfield2s] FROM mytable

You might need to provide specific formats rather than 'Scientific' to alter
the precision and so on.

Peter Jamieson

"GCNY" wrote in message
news
Where? As a macro for each of the 8 Scientific format merge fileds or just
once?

"Doug Robbins - Word MVP" wrote:

No, you would put the expression in the mail merge main document.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"GCNY" wrote in message
news
Thank you for the response. I will try it.

In a QBE form do I set up an expression and enter this code after the
colon?

"Doug Robbins - Word MVP" wrote:

The following was posted by fellow MVP Macropod:

Quote

The following compound field will return the scientific notation of
any
+ve
value between 10^-9 and 10^9:
{QUOTE
{SET a {SourceVal}}
{SET
b{=9-(a10^9)-(a10^8)-(a10^7)-(a10^6)-(a10^5)-(a10^4)-(a10^3)-(a10^2)
-(a10^1)-(a10^0)-(a10^-1)-(a10^-2)-(a10^-3)-(a10^-4)-(a10^-5)-(a10^-
6)-(a10^-7)-(a10^-8)}}
{SET c{=int(a/10^b)+mod(a,10^b)/10^b}}
{c \# 0.00}E{b \# +00;-00}}
where 'SourceVal' is the input, which could be a formula taking its
input
from two formfields. You can extend the range easily enough by adding
more
terms.

All the field braces (i.e. { }) are created in pairs via Ctrl-F9. I've
laid
the coding out with line breaks to separate the key portions of the
coding,
but you don't really need them.

Unquote

I am not sure if this will work with mailmerge, but I think that the
thing
to do would be to replace

{SourceVal}

with your Merge Field that contains the value.
--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"GCNY" wrote in message
...
I have an Access 2003 database where some of the number fields are in
scientific format.

In Word 2003 when I insert the scientific formatted fields, they
appear
in
decimal format.

How can I handle this formatting problem?








  #10   Report Post  
Posted to microsoft.public.word.mailmerge.fields
macropod macropod is offline
external usenet poster
 
Posts: 1,002
Default Scientific format

Hi Doug & GCNY,

A similar query about mailmerge with scientific notations appeared today in the docmanagement NG also. My suggested coding is:

{QUOTE
{SET z{MERGEFIELD dbValue}}
{SET a{=ABS(z)}}
{SET
b{=9-(a10^9)-(a10^8)-(a10^7)-(a10^6)-(a10^5)-(a10^4)-(a10^3)-(a10^2)-(a10^1)-(a10^0)-(a10^-1)-(a10^-2)-(a10^-3)-(a10^-4)-(a10^-5)-(a10^-6)-(a10^-7)-(a10^-8)}}
{SET c{=int(a/10^b)+mod(a,10^b)/10^b}}
{c \# 0.00}E{b \# +00;-00}}

where 'dbValue' is the mergefield's name.

If the same value is to appear in multiple places, then bookmarking the above field and using cross-references to it would do the
job. Otherwise, as Doug says, you'll need one copy of the Word field for each db field - a simple copy, paste & edit process once
you've got the first field coded.

The core of the above field is included in my Word Field Maths 'tutorial', at:
http://www.wopr.com/cgi-bin/w3t/show...?Number=365442

Cheers

--
macropod
[MVP - Microsoft Word]
-------------------------

"Doug Robbins - Word MVP" wrote in message ...
The following was posted by fellow MVP Macropod:

Quote

The following compound field will return the scientific notation of any +ve
value between 10^-9 and 10^9:
{QUOTE
{SET a {SourceVal}}
{SET
b{=9-(a10^9)-(a10^8)-(a10^7)-(a10^6)-(a10^5)-(a10^4)-(a10^3)-(a10^2)
-(a10^1)-(a10^0)-(a10^-1)-(a10^-2)-(a10^-3)-(a10^-4)-(a10^-5)-(a10^-
6)-(a10^-7)-(a10^-8)}}
{SET c{=int(a/10^b)+mod(a,10^b)/10^b}}
{c \# 0.00}E{b \# +00;-00}}
where 'SourceVal' is the input, which could be a formula taking its input
from two formfields. You can extend the range easily enough by adding more
terms.

All the field braces (i.e. { }) are created in pairs via Ctrl-F9. I've laid
the coding out with line breaks to separate the key portions of the coding,
but you don't really need them.

Unquote

I am not sure if this will work with mailmerge, but I think that the thing to do would be to replace

{SourceVal}

with your Merge Field that contains the value.
--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"GCNY" wrote in message ...
I have an Access 2003 database where some of the number fields are in
scientific format.

In Word 2003 when I insert the scientific formatted fields, they appear in
decimal format.

How can I handle this formatting problem?




Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i insert scientific notation johnmc Microsoft Word Help 3 April 22nd 23 06:32 AM
Scientific notation MarkTheNuke Mailmerge 2 May 21st 06 12:20 AM
Scientific Notebook? cybermum Microsoft Word Help 2 March 20th 06 04:12 AM
Scientific thesis writing - help!! Will Doward Page Layout 2 August 13th 05 12:52 PM
scientific notation. quasi Microsoft Word Help 1 May 14th 05 09:11 AM


All times are GMT +1. The time now is 09:17 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"