CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 CCDlookup where contains like in field data

Print topic Send  topic

Author Message
JimbobGilb

Posts: 27
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
View profile  Send private message
eratech


Posts: 510
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
View profile  Send private message
JimbobGilb

Posts: 27
Posted: 08/18/2016, 7:03 AM

Hi,

I'm using access database

Thanks,
View profile  Send private message
eratech


Posts: 510
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
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by UltraApps.com  and YesSoftware, Inc.