Truncate a text field.


J

jgaard

Hi

I have a series of "problems" that I need to solve. I'm quite new to
access and databases overall.

This job is solved today by an excel worksheet, and it sucks.
Errors seam to occur daily and every time you correct an error you
risk creating a new one.
Locking fields so that duplicates can not occur seams to be the way
that is why I'm having this go at access.

I have 2 tables: Today and tomorrow.

They consist of these fields.
Server name, NIC1, NIC2

*** Example Data ***
Fred, Flintstone-01 Gi1/0/12, Flintstone-02 Gi1/0/12
Barney, Rubble-02 Gi4/0/48, Rubble-01 Gi4/0/48
***

The thing is I want to export to an csv file, so that it looks like
this:
"Fred
1/12"
"Barney
4/48"
This will enable me to print the values of on to a lable that I put on
to the cables.

I guess I want to truncate values and export them to a CSV file.

How do I do this?

J;-)
 
Ad

Advertisements

J

John W. Vinson

Hi

I have a series of "problems" that I need to solve. I'm quite new to
access and databases overall.

This job is solved today by an excel worksheet, and it sucks.
Errors seam to occur daily and every time you correct an error you
risk creating a new one.
Locking fields so that duplicates can not occur seams to be the way
that is why I'm having this go at access.

I have 2 tables: Today and tomorrow.

They consist of these fields.
Server name, NIC1, NIC2

*** Example Data ***
Fred, Flintstone-01 Gi1/0/12, Flintstone-02 Gi1/0/12
Barney, Rubble-02 Gi4/0/48, Rubble-01 Gi4/0/48
***

The thing is I want to export to an csv file, so that it looks like
this:
"Fred
1/12"
"Barney
4/48"
This will enable me to print the values of on to a lable that I put on
to the cables.

I guess I want to truncate values and export them to a CSV file.

How do I do this?

J;-)
WHOA. You're fairly far off track!

Separate tables for "today" and "tomorrow" is simply wrong design. Data is not
stored in table names; worse, if you have a table whose definition is "TODAY"
then you can be absolutely certain that it will be complete garbage within 24
hours!

Could you explain the nature of the data, and how "today and tomorrow" come
into the picture? Given the data that you show, what's the rationale for
generating the text string

1/12

from the text strings

Flintstone-01 Gi1/0/12, Flintstone-02 Gi1/0/12

One basic idea that you'll need to come to grips with is the distinction
between data STORAGE and data PRESENTATION. Once you have properly normalized
data stored in a table, it's pretty easy to use string manipulation
expressions to extract pieces of a string, combine them, etc. and print them
on a label (probably using an Access Report to do so). But I'm at a loss how
to proceed based on what you've posted.
--

John W. Vinson [MVP]
Microsoft's replacements for these newsgroups:
http://social.msdn.microsoft.com/Forums/en-US/accessdev/
http://social.answers.microsoft.com/Forums/en-US/addbuz/
and see also http://www.utteraccess.com
 

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