Maintaining data format (1 Viewer)

Peter Bellamy

Registered User.
Local time
Today, 13:54
Joined
Dec 3, 2005
Messages
295
I am using a Make Table query and it incudes the numeric value of some barcodes. They are 13 digits long.

I have tried formating the selected field with 0000000000000 in the query but it insists on recording it in scientific format.
I can then alter it in the table, but as I want to export the data from the table to a text file immediately I don't want to have to manually change it.

How can I force it into the correct format?

Thanks
 

jdraw

Super Moderator
Staff member
Local time
Today, 08:54
Joined
Jan 23, 2006
Messages
15,394
Can you show a sample?
Do you do any arithmetic on the value?
If not, would it help to make it a text field?
 

Peter Bellamy

Registered User.
Local time
Today, 13:54
Joined
Dec 3, 2005
Messages
295
Thanks for your reply.
I will try and provide a sample, it is however part of a big dB.

No arithmetic so maybe a text field might work, I will try when I return to work.
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 13:54
Joined
Sep 12, 2006
Messages
15,710
a number cannot be 13 digits long

max number (longint) in access is about 2billion, which is 10 digits long - otherwise you will get an overflow. I am not sure about doubles, but I guess thats why you are getting scientific representation. you could try currency or decimal, but I guess they dont go that long

in any event, if a bar code has a leading zero - you will be stymied anyway

so I think, you have to treat the barcodes as text strings
 

PNGBill

Win10 Office Pro 2016
Local time
Tomorrow, 00:54
Joined
Jul 15, 2008
Messages
2,271
So Bill Gates can't use Access to keep track of his cheque book balance:rolleyes:
 

Peter Bellamy

Registered User.
Local time
Today, 13:54
Joined
Dec 3, 2005
Messages
295
On reflection I need to maintain it as a number so it can be turned back into a barcode as I don't know what tech skills the recepients have.

They have no leading zeros.

My forms handles it ok and the table containing them handles them fine, it is just the Make Table query that is being difficult !
 

DCrake

Remembered
Local time
Today, 13:54
Joined
Jun 8, 2005
Messages
8,632
Why are you making tables anyway. This will only bloat the db. You really should have a pre prepared table and run deletes and appends to it. By doing so you can predefine the filed formats.
 

Peter Bellamy

Registered User.
Local time
Today, 13:54
Joined
Dec 3, 2005
Messages
295
I am exporting selected data to text files for customers use (they are price update files).
It seemed the easiest way to select the data from several tables into one export table then convert them into named text files. They are not big, only about 5 cols x 120 rows.

pnb
 

Users who are viewing this thread

Top Bottom