Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ListFind & Find Not Working

Status
Not open for further replies.

BradF

Programmer
Mar 29, 2005
28
US
Here's the cfoutput, notice how the last two are always 0 yet they should be returning non-0 values:

Code:
#VARIABLES.lstTraining# - #qryTraining.TNG_SYS_NR# - #ListFind(VARIABLES.lstTraining, qryTraining.TNG_SYS_NR)# - #Find(qryTraining.TNG_SYS_NR,VARIABLES.lstTraining)#<br/>

Here's the output:

Code:
0443,0559,0566,0708,0785 - 0443 - 0 - 0
0443,0559,0566,0708,0785 - 0443 - 0 - 0
0443,0559,0566,0708,0785 - 0443 - 0 - 0
0443,0559,0566,0708,0785 - 0443 - 0 - 0
0443,0559,0566,0708,0785 - 0443 - 0 - 0
0443,0559,0566,0708,0785 - 0443 - 0 - 0
0443,0559,0566,0708,0785 - 0443 - 0 - 0
0443,0559,0566,0708,0785 - 0443 - 0 - 0

Please help! I'm ready to jump out the window or throw my PC out, OR BOTH!
 
Try converting to a quoted value list. Your values aren't numeric.

HTH,

Phil Hegedusich
Senior Programmer/Analyst
IIMAK
-----------
I'll have the roast duck with the mango salsa.
 
Well, I thought that would work... Apparently not... Here's the code/output:

Code:
Code:
#VARIABLES.lstTraining# - #qryTraining.TNG_SYS_NR# - #ListFind(VARIABLES.lstTraining, qryTraining.TNG_SYS_NR)# - #Find(qryTraining.TNG_SYS_NR,VARIABLES.lstTraining)#<br/>

Output:
Code:
'0443','0559','0566','0708','0785' - 0443 - 0 - 0
'0443','0559','0566','0708','0785' - 0443 - 0 - 0
'0443','0559','0566','0708','0785' - 0443 - 0 - 0
'0443','0559','0566','0708','0785' - 0443 - 0 - 0
'0443','0559','0566','0708','0785' - 0443 - 0 - 0


 
Fixed by doing the following:

Code:
ListFind(VARIABLES.lstTraining, RTRIM(qryTraining.TNG_SYS_NR))
Even though the output of qryTraining.TNG_SYS_NR didn't show it (because of the whitespace ignore of HTML) it was a CHAR(6) value.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top