JimbobGilb
Posts: 28
|
Posted: 08/17/2016, 8:40 AM |
|
HI there, how would i search a field in another table if it contains like data.
I am using this in before show row event which works if = but i need it to be "SwipeCardNo contains like" rather than "SwipeCardNo ="
ClockingMachine.ID.value = ccDLookup("EmployeeID", "Employees", "SwipeCardNo =" & DBConnection1.ToSQL(clockingmachine.CardNumber.value, ccsText),dbconnection1)
Please help!!!
Thanks,
James
|
 |
 |
eratech
Posts: 513
|
Posted: 08/18/2016, 6:36 AM |
|
Which database? You should be able to use LIKE if careful with syntax
Cheers
Eric
_________________
CCS 3/4/5 ASP Classic, VB.NET, PHP
Melbourne, Victoria, Australia |
 |
 |
JimbobGilb
Posts: 28
|
Posted: 08/18/2016, 7:03 AM |
|
Hi,
I'm using access database
Thanks,
|
 |
 |
eratech
Posts: 513
|
Posted: 08/19/2016, 12:29 AM |
|
@JimbobGilb
Try making the WHERE part (3rd parameter of CCDLookup) so it makes an Access version of LIKE:
"SwipeCardNo LIKE '*" & DBConnection1.ToSQL(clockingmachine.CardNumber.value, ccsText) & "*'"
so you get the result of:
SwipeCardNo LIKE '*445*'
(see here for Access syntax for LIKE queries: http://www.techonthenet.com/access/queries/like2007.php )
Cheers
Eric
_________________
CCS 3/4/5 ASP Classic, VB.NET, PHP
Melbourne, Victoria, Australia |
 |
 |
|