Export Table Data To Formatted Text File

  • Thread starter Thread starter NEWSGROUPS
  • Start date Start date
N

NEWSGROUPS

I have a need to export table data to a formatted text file and have been
mostly sucessful. One problem still remains. One of the fields I have to
export to this text file is a number field formatted as a double that
represents a dollar amount (what this means for instance is the amount
$255.00 is stored in the table as 255 and the amount $255.50 is stored as
255.5). I needed to export these fields without the decimal point so what
should be on the text file for the $255.00 is 25500 and the $255.50 will be
shown as 25550 with the right most 2 digits being the implied decimal. The
problem here as you can see from my example is there are not always 2
decimal places on all my records. I tried appending the records to a
currency field which did display the correct format but when I pass this to
a function to strip the decimal place or use an in string to get the left()
of the decimal the $255.00 returns an error and the $255.50 returns 2555 as
if the decimal does not exist. Can anyone offer assistance in this matter as
I have tried everything possible.



Marco
 
I have a need to export table data to a formatted text file and have been
mostly sucessful. One problem still remains. One of the fields I have to
export to this text file is a number field formatted as a double that
represents a dollar amount (what this means for instance is the amount
$255.00 is stored in the table as 255 and the amount $255.50 is stored as
255.5). I needed to export these fields without the decimal point so what
should be on the text file for the $255.00 is 25500 and the $255.50 will be
shown as 25550 with the right most 2 digits being the implied decimal. The
problem here as you can see from my example is there are not always 2
decimal places on all my records. I tried appending the records to a
currency field which did display the correct format but when I pass this to
a function to strip the decimal place or use an in string to get the left()
of the decimal the $255.00 returns an error and the $255.50 returns 2555 as
if the decimal does not exist. Can anyone offer assistance in this matter as
I have tried everything possible.



Marco

Just multiply the value by 100, trim any remaining decimals, and export that
calculated field:

Fix(100. * [yourfieldname])



John W. Vinson [MVP]
 
Thank you it worked perfectly. I guess I was over thinking this. I though it
had to be more complex.

Thanks again,
Marco


John W. Vinson said:
I have a need to export table data to a formatted text file and have been
mostly sucessful. One problem still remains. One of the fields I have to
export to this text file is a number field formatted as a double that
represents a dollar amount (what this means for instance is the amount
$255.00 is stored in the table as 255 and the amount $255.50 is stored as
255.5). I needed to export these fields without the decimal point so what
should be on the text file for the $255.00 is 25500 and the $255.50 will
be
shown as 25550 with the right most 2 digits being the implied decimal. The
problem here as you can see from my example is there are not always 2
decimal places on all my records. I tried appending the records to a
currency field which did display the correct format but when I pass this
to
a function to strip the decimal place or use an in string to get the
left()
of the decimal the $255.00 returns an error and the $255.50 returns 2555
as
if the decimal does not exist. Can anyone offer assistance in this matter
as
I have tried everything possible.



Marco

Just multiply the value by 100, trim any remaining decimals, and export
that
calculated field:

Fix(100. * [yourfieldname])



John W. Vinson [MVP]
 
Back
Top