473,406 Members | 2,259 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Fixed width export strips leading zeros...bad

I run a fixed-width export based on a query, and the query looks like
this...

Clients.SSN, Clients.ClientID, ServiceEvents.SeviceDate,
CStr(Format([ServiceEvents.Unit],"0000")) AS Servs, "28" AS SETTING,
FROM Clients INNER JOIN ServiceEvents ON
Clients.AutoID=ServiceEvents.AutoID
WHERE ServiceEvents.Sub=False;

Now, this looks fine when I few the query, and the "Unit" field is 4
characters, with leading zeros. The export spec I use also assigns
the field 4 spaces. When I actually export though, there are no more
leading zeros, and everything is left justified. If this was a CSV,
I'd understand Access's stupid compulsion to strip these zeros, but
it's not. I've looked all over this group and have no been able to
find anything that works, plus it's all from nearly 4 years ago. Is
there anything new in Access 2002 that just hasn't been mentioned yet?

Thanks,
Andrew
Nov 13 '05 #1
1 2587
I also wanted to add that the format of the "Unit" field is text.
"Andrew" <sp****@gnt.net> wrote in message
news:d8**************************@posting.google.c om...
I run a fixed-width export based on a query, and the query looks like
this...

Clients.SSN, Clients.ClientID, ServiceEvents.SeviceDate,
CStr(Format([ServiceEvents.Unit],"0000")) AS Servs, "28" AS SETTING,
FROM Clients INNER JOIN ServiceEvents ON
Clients.AutoID=ServiceEvents.AutoID
WHERE ServiceEvents.Sub=False;

Now, this looks fine when I few the query, and the "Unit" field is 4
characters, with leading zeros. The export spec I use also assigns
the field 4 spaces. When I actually export though, there are no more
leading zeros, and everything is left justified. If this was a CSV,
I'd understand Access's stupid compulsion to strip these zeros, but
it's not. I've looked all over this group and have no been able to
find anything that works, plus it's all from nearly 4 years ago. Is
there anything new in Access 2002 that just hasn't been mentioned yet?

Thanks,
Andrew

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Anil | last post by:
Hi , I am exporting my data from the web datagrid to excel sheet using the rendercontrol method. but the problem is that here I do not have a control over the excel sheet, so cannot do any...
5
by: samik_tanik | last post by:
I need to export a datagrid to Excel. I could did this. But, also need to keep the leading zeros in the data. How can I acheive this? Any help would be appreciated. -- Thanking you in...
1
by: mmmgood1 | last post by:
Help, I'm linking an excel spreadsheet in access and I have datafields with leading zeros (01021). When the file is linked in access, I get a #num in the field with the leading zeros. The zeros...
0
by: Anjo Gasa | last post by:
I have a couple questions regarding iostreams output. I just finished searching the group archive and don't believe they have been specifically address before. 1. How can one remove leading...
6
by: JimmyKoolPantz | last post by:
Task: Customer wants a script of the data that was processed in a "CSV" file. Problem: Zip-Code leading zeros are dropped Basically we have a client that has requested a custom script for...
5
by: Rowan | last post by:
Hi, I am somewhat new to .net and c#. (What I learned in previous co has to be unlearned). I am doing something that seems simple but I think there is a better way than how I learned to do it. ...
5
by: Reggie | last post by:
Hi and TIA! I have an export procedure that exports my data from my datagrids to excel. The problem is that I lose leading zero's cause excel removes them and doesn't treat them as text. Is it...
0
by: Monty | last post by:
Hi All, I am having a problem with leading zeros being stripped from fields in a CSV file when I bring them in using Jet/OleDB. In VB.Net/VS 2008, I am accessing a CSV file like so: sSQL =...
8
by: jcgads | last post by:
In ACCESS 2007 I need the results of a report in a fixed format file format text file. The record length of the file is 80 characters. The first record is a header record. It has the format of ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.