Re: Using part of a field



Since you are probably connecting via MS Query and sending a SQL query to
the database, you ought to be able to modify the SQL that MS Query generates
to remove any trailing ".", as long as the SQL dialect being used can do it.

You can do that either while you are working in SQL Query, or directly using
Word VBA and the OpenDataSource method - if so, I can give you some more
hints but it would be helpful to know
a. which database you're using and whether you're familiar with its dialect
of SQL
b. whether you are familiar with either MS Query or Word VBA

If you would prefer to use Word fields, then you could use a lengthy set of
IF fields as follows, but the exact fields would depend on exactly what the
initial field can contain, e.g., which of the following can it contain:
a. <blank>
b. lowercase unaccented latin initial (a-z)
c. uppercase unaccented latin initial (A-Z)
d. (a), (b) or (c) followed by a period/full stop
e. other characters, one or many, either followed by a full stop or not
f. and so on...

But assuming it's (c) followed by a period, you could try the following
fields - all the {} need to be the special field braces you can insert using
ctrl-F9, and you would need to substitute the name of your initial field
where I've used myinitialfield

{ SET I { MERGEFIELD myinitialfield }
}{ IF "{ I }" = "A*" "A" ""
}{ IF "{ I }" = "B*" "B" ""
}{ IF "{ I }" = "C*" "C" ""
}
and so on until
}{ IF "{ I }" = "Z*" "Z" ""
}

Once you've created the pack of fields you need, you can save them to an
Autotext (or another file) for re-use. I've used the wildcard "*" which
matches multiple characters rather than "?" (matches one) or "." simple for
flexibility. If the Database field could contain lower case but you actually
want uppercase in your letter, you can use
{ MERGEFIELD myinitialfield \*Upper }

in each comparison.

There are other possible approaches...

Peter Jamieson

"Chris Stammers" <ChrisStammers@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:2CD4621A-E7DE-47FF-8DB1-F56125D06058@xxxxxxxxxxxxxxxx
Hello,

I have to prepare a letter and the client has requested that the full stop
after a person's initial be removed. This is in our mainframe database
like
this and as such can't be removed from there. Is there a way to use part
of a
field or tell it to remove punctuation? I am using word 2000.

Thanks,
Chris


.



Relevant Pages

  • Re: DBMS and lisp, etc.
    ... Naively implemented with SQL, again for 10 ... (1 query for the initial orders, 1 query for each order for its ... soon as you upgrade to the SQL database. ... (eq (order-customer orderA) ...
    (comp.lang.lisp)
  • Re: Using part of a field
    ... I'm not familiar with MS Query or Word VBA. ... the database, you ought to be able to modify the SQL that MS Query generates ... as long as the SQL dialect being used can do it. ...
    (microsoft.public.word.mailmerge.fields)
  • Re: complex filter and calculations in access
    ... switch to SQL view. ... query by switching to datasheet view, ... of your database using the from address in this post. ... pre-op infections yes/no ...
    (microsoft.public.access.queries)
  • Re: A little more meat this week
    ... implementation with a query processor capable of returning a result set ... then we can call it a result bag (SQL ... I'm looking at the data model and not database tools at this ... for a s/w developer and a s/w developer simplifies for the end user). ...
    (comp.databases.pick)
  • Re: complex filter and calculations in access
    ... when using a subquery on the same table as the main query, ... switch to SQL view. ... of your database using the from address in this post. ...
    (microsoft.public.access.queries)

Loading