Ask a Question related to Coldfusion Database Access, Design and Development.
-
D. Miller #1
Preserving leading zeroes in a query
Hello,
I'm trying to run a query of queries on an employee directory, and use the
employees id number to link to a "Details" page. Unfortunately, these id
numbers are of varying lengths and have leading zeroes which are stripped out
when my QofQ runs. The few suggestions I've seen for dealing with leading
zeroes all relate to using numberFormat() or the SQL ZEROFILL command. But,
since my numbers are of varying lengths, this isn't going to work for me. Can
anyone tell me how to preserve my leading zeroes?
If it makes a difference, I'm running on CFMX 6.1, and the original query is
being created with QueryNew(), from an XML source.
Thanks in advance.
D. Miller Guest
-
Exporting database contents to Excel but missing leading zeroes???
I have the following script working well for database exports to Excell. However, all my zip codes are missing the leading zeros (probably other... -
#40020 [NEW]: int values with leading zeroes
From: pav at oook dot cz Operating system: FreeBSD PHP version: 5.2.0 PHP Bug Type: SOAP related Bug description: int... -
#40020 [Opn->Bgs]: int values with leading zeroes
ID: 40020 Updated by: tony2001@php.net Reported By: pav at oook dot cz -Status: Open +Status: Bogus... -
Leading zeroes
Hello, How can I suppress the leading zeroes, except one when all positions are 0; for example: 000015 will be 15 000000 will be 0 thank... -
leading zeroes in day, month
Hello! I would like to show day(date) and month(date) with leading zeroes. Is it any way to do that Mitja -
Dan Bracuk #2
Re: Preserving leading zeroes in a query
Basically, you have to force the field to be text. Make sure the first row is
strictly alpha. Since you are building your own, do something like this:
create the query variable
populate the first row with something that will force that fields to be text.
loop through your file and add the real data.
Then in your QofQ, add
and that_file <> 'what you put in that field'
to your where clause.
Dan Bracuk Guest
-
D. Miller #3
Re: Preserving leading zeroes in a query
Thanks, Dan. I ended up adding an "x" in front of the zeroes, then removing it when displaying the link.
Thanks!
D. Miller Guest



Reply With Quote

