bank check file

M

margaret

We send a file to our bank everyday that states what checks are written and
for how much. The format must be very exact and it has to be a text file.
So my thought was to take my table which has the chno, ckamt, chdate and
create this file using a query then export to a text file. The field for
check amount must always be 12 characters long. So $50.00 would be
000000005000, $2525.75 would be 000000225275, etc. My brain is fried... I
can't figure how to get the leading zeros and the dollar to always be 12
characters.

Any ideas?
 
N

ND Pard

Because you do NOT want the decimal place shown, the amount needs to be
multiplied by 100.

Try this in the Field line of your query grid:

Format([ckamt]*100,"000000000000")

Good Luck.
 
M

MGFoster

margaret said:
We send a file to our bank everyday that states what checks are written and
for how much. The format must be very exact and it has to be a text file.
So my thought was to take my table which has the chno, ckamt, chdate and
create this file using a query then export to a text file. The field for
check amount must always be 12 characters long. So $50.00 would be
000000005000, $2525.75 would be 000000225275, etc. My brain is fried... I
can't figure how to get the leading zeros and the dollar to always be 12
characters.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

It's pretty easy using the Format() function:

You can set up a Constant like this: "000000000000" (that's 12 zeros).

CONST ZEROS = "000000000000"

Then use it in the Format() function like this:

Format(50.00 * 100, ZEROS)

Will yield this: 000000005000

The multiplication by 100 gets rid of the decimal point. You'll have to
be sure all numbers have only 2 decimal places after the decimal point.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
** Respond only to this newsgroup. I DO NOT respond to emails **

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBSMBbMIechKqOuFEgEQKCbwCg3UUgA+d+BZ1RjgqiaEc+qr8Qu8cAn02D
zXOdi8EzFZW1wArxXC7VT/42
=2Y4G
-----END PGP SIGNATURE-----
 
M

margaret

Wow ... you're also very good. That worked perfectly. Thanks so much.

ND Pard said:
Because you do NOT want the decimal place shown, the amount needs to be
multiplied by 100.

Try this in the Field line of your query grid:

Format([ckamt]*100,"000000000000")

Good Luck.



margaret said:
We send a file to our bank everyday that states what checks are written and
for how much. The format must be very exact and it has to be a text file.
So my thought was to take my table which has the chno, ckamt, chdate and
create this file using a query then export to a text file. The field for
check amount must always be 12 characters long. So $50.00 would be
000000005000, $2525.75 would be 000000225275, etc. My brain is fried... I
can't figure how to get the leading zeros and the dollar to always be 12
characters.

Any ideas?
 

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