export to csv - can t get rid of decimal

  • Thread starter Thread starter pierre
  • Start date Start date
P

pierre

Hi all,

I tried in a lot of way
to export a two fields query in csv file format

my data is

Qt, Code like

4,code1
44,code2
....

The problem i have is that when i use
docmd transfertext acexportdelim

i have a file like
4.00,code1
44.00,code2

How can i get rid of the decimals?

I modify the property of the query to have 0 decimal, the query show no
decimal at all but the exported file still have the 0. Ichange the
quantity to a long type - still the same!!!

Is it an access bug or what?

rEgards,
pierre
 
Change the field with the number to a calculated field in the query, and
cast it as a long integer:

SELECT CLng(Qt) AS Qqt,
Code:
FROM MyTableName;

Or format the output:

SELECT Format(Qt, "0") AS Qqt, [Code]
FROM MyTableName;
 
Ken said:
Change the field with the number to a calculated field in the query, and
cast it as a long integer:

SELECT CLng(Qt) AS Qqt,
Code:
FROM MyTableName;

Or format the output:

SELECT Format(Qt, "0") AS Qqt, [Code]
FROM MyTableName;
[/QUOTE]

I change it and
I still have the 1.00

Before i change it, i can see
the number in the query as 1

??

I will be oblige to export to an access table
in a text field and build the string?

regards,
pierre
 
Post the actual SQL statement that you're using.

--

Ken Snell
<MS ACCESS MVP>

pierre said:
Ken said:
Change the field with the number to a calculated field in the query, and
cast it as a long integer:

SELECT CLng(Qt) AS Qqt,
Code:
FROM MyTableName;

Or format the output:

SELECT Format(Qt, "0") AS Qqt, [Code]
FROM MyTableName;
[/QUOTE]

I change it and
I still have the 1.00

Before i change it, i can see
the number in the query as 1

??

I will be oblige to export to an access table
in a text field and build the string?

regards,
pierre[/QUOTE]
 
Back
Top