473,387 Members | 1,516 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,387 software developers and data experts.

Date changes and leading zeroes

Access 2003 on XP pro machine...

i'm running a crosstab query and an export to a 3rd party company showing different benefit plans for employees; specifically dental, vision and medical pulling the effective dates (date which the plan when into effect). generally the plans all have the same effective date. however in the case they don't 2 lines are returned for the same employee; the first containing, for example, their medical and vision effective dated 10/1/2007 w/ dental blank and their dental effective dated 11/1/2007 because he added his wife to his dental plan, leaving the medical/vision columns blank . those who would be receiving the information get errors when loading it into their system because of seperate lines. they claim they need everything on one line with the greatest effective date value in that line, but i am unable to figure out how. any assistance would be greatly appreciated.

also, i feel the need to mention this as i have searched here and google and have yet to find a solution, same database;
the final product sent out is a fixed width flatfile (text) which includes SSNs. the way i keep everything formatted ensures the leading zeroes remain all the way through to the final step of the export through Access. however when viewing the flatfile all leading zeroes have been stripped and the SSN fields are left justified.

original: 454545454 xxxxxx454545454xxxx
orinigal: 056565656 xxxxxx56565656_xxxx
original: 006767676 xxxxxx6767676__xxxx

note: the underscore represents a space

i tried formatting the field as a Text exporting as text, tried as number exporting as text, as a number but running query converting it to a string, as a number changing the format to 000000000 but still no success

any assistance would be greatly appreciated.
Nov 15 '07 #1
9 2996
nico5038
3,080 Expert 2GB
Did you try to use for the SSN part:
Expand|Select|Wrap|Line Numbers
  1. select right("00000000" & SSN,8) as SSNtext, ...
  2.  
Nic;o)
Nov 16 '07 #2
i just did and it still returns the same results. i am using Access 03 but saved in Access 2000 file format, would that have anything to do with it?
Nov 20 '07 #3
nico5038
3,080 Expert 2GB
Hmm, guess the crosstable queriy disturbes the datatype.
I would create a "Create table" query using the crosstable query as "input".
Next define a query with the "0000000" trick to save the result in a textfile.

Nic;o)
Nov 20 '07 #4
just tried that and it doesn't work. are these tactics working for you when you try?
Nov 26 '07 #5
nico5038
3,080 Expert 2GB
It does, however when you export the query, the export specification might cause the string to be transformed into a number.
Did you try a manual export and did you press the [Advanced] button ?

Nic;o)
Nov 26 '07 #6
Yes, and i have specs but still drops the leading zeroes.
Nov 30 '07 #7
nico5038
3,080 Expert 2GB
Did you verify that the "zero losing" field is defined as Text ?

Did you open the resulting file with notepad and not excel to verify?

Nic;o)
Nov 30 '07 #8
yes, on both counts. i need to verify with notepad because it is to be sent/loaded as a fixed length flatfile.
i think i've about given up on trying to change import/export parameter and just load all SSNs with a symbol infront of them, such as "&" or "$", something which will never be found in the fields I'm querying, and fix the length to add 1 space on the export. when i get the flatfile, do a find/replace for the symbol and have it replace it with nothing
Dec 7 '07 #9
nico5038
3,080 Expert 2GB
Hmm, running out of options.
The prefixing is indeed one of the last options, besides processing the recordset and using OPEN/Print #/CLOSE for writing to a textfile.

Nic;o)
Dec 7 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: Colin Steadman | last post by:
I'm a stupid ASP programmer and I dont do Javascript (except for very simple tasks anyway), and I'm in a bit of a predicament. I've used a javascript table sorting script from here: ...
5
by: goochey | last post by:
I'm trying to convert a Julian Date (Format "4365") into an actual calendar date in Visual Basic, can anyone help me out with this.
2
by: Abby Lee | last post by:
http://www.apriori-it.co.uk/FormatDate.asp I found the above date format script while doing a search. it works fine except with the format mm/dd/yyyy. Type in 01/02/03 and hit the "format date"...
7
by: Don | last post by:
Hi all, With regards to the following, how do I append the datetimestamp to the filenames in the form? The files are processed using the PHP script that follows below. Thanks in advance,...
3
by: Andrew Poulos | last post by:
I'm updating a db in which I have a column of Date/Time data type. The regional settings here for short date are: day / month / full year eg. 28/4/2005 It's easy enough for me to build a string...
5
by: Bob Sanderson | last post by:
I would like to use a date picker on a web page input form. I found one which does what I want but the date format it outputs is not correct for my form. The script contains the following: //...
1
by: Mike P | last post by:
I'm trying to write the contents of a csv file to a table, but I am having problems with fields with leading zeroes. Whenever I save as csv I lose the leading zeroes. Does anybody know how to...
8
by: stainless | last post by:
Is it possible, using the ToString function, to take an integer and conver to a string of fiexd width with the leading spaces padded with zeroes. e.g. integer 123 converted to a string of length...
2
by: DanCole42 | last post by:
Newbie question, here. I have a database that frequently imports ZIP code data that frequently needs cleaning: 12365 6487 64684-3543 3213-6546
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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,...

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.