export to csv - can t get rid of decimal

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
 
K

Ken Snell \(MVP\)

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;
 
P

pierre

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
 
K

Ken Snell \(MVP\)

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]
 

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