Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
The Like Clause
Message
De
14/06/2012 11:50:46
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
The Like Clause
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01546034
Message ID:
01546034
Vues:
74
I am trying to get the Like clause to work in my SQL, but I keep coming back with no results. Can anybody see what I am doing wrong?

Thanks!
Lparameters tnOption

Thisform.ofile.Open('bond')
Thisform.ofile.Open('bond_redemptions')

Local lcTitle, lnKey, laResults[1,2], i, lcProject

If tnOption = 1
	Select Distinct Rtrim(Title) + ' ' + title2 As cTitle, bond_redemptions.ky ;
		FROM bond ;
		INNER Join bond_redemptions On ;
		bond.ky = bondky ;
		WHERE reDate = This.txtInput.Value ;
		INTO Array laResults ;
		order By cTitle
ELSE
	lcProject = Alltrim(This.txtInput.Value)+'*'
	Select Distinct Rtrim(Title) + ' ' + RTRIM(title2) + '   ' + Dtoc(bond_redemptions.reDate) + ;
		'   ' + Alltrim(Str(bond_redemptions.amount)) As cTitle, bond_redemptions.ky ;
		FROM bond ;
		INNER Join bond_redemptions On ;
		bond.ky = bondky ;
		WHERE bond_redemptions.Project like lcProject ;
		INTO Array laResults ;
		order By cTitle
Endif

lnItems = _Tally

Use In bond
Use In bond_redemptions

With This.lstBonds
	.Clear()
	For i = 1 To lnItems
		.AddItem(laResults[i, 1])
		.ItemData[.NewIndex] = laResults[i, 2]
		.ListIndex = i
	Endfor
	If .ListIndex = 0
		.ListIndex = 1
	Endif
	.ListIndex = 1
Endwith



This.lstBonds.SetFocus()
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform