Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
The Like Clause
Message
From
14/06/2012 11:50:46
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
The Like Clause
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01546034
Message ID:
01546034
Views:
73
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()
Next
Reply
Map
View

Click here to load this message in the networking platform