May 25, 20169 yr I'm attempting to do a search for a value that was entered by a user. They want to be able to enter in part of a project number and have the system look for it. I understand the LIKE operator and I can get it to work if I pass the argument of something like %12345% but I want to pass in something that looks like the following: wildcard plus value entered by user plus wildcard. I've tried the following (let me try this again with the right code): Let ( [ project_id = "%" & d_tmd_tmh::zd_time_dtl_prj_num & "%" ; SQL = ExecuteSQL ( " SELECT a.\"__project_id\" FROM \"d_prj\" a WHERE a.\"zd_prj_number\" LIKE ? " ; "|" ; ¶ ; project_id ) ] ; SQL ) I'm not getting an error. I'm just not getting any results. When I manually substitute the same value I am testing by changing it to this: Let ( [ project_id = "%12345%" ; SQL = ExecuteSQL ( " SELECT a.\"__project_id\" FROM \"d_prj\" a WHERE a.\"zd_prj_number\" LIKE ? " ; "|" ; ¶ ; project_id ) ] ; project_id ) It works. Any pointers in the right direction would be appreciated. Never mind... I reran things and it now seems to be working. Edited May 25, 20169 yr by oakbridge Posted wrong block of code
May 26, 20169 yr Yes, this is the FQL forum. I just wanted to remind you that FileMaker has some great 'wildcards' for finds. http://help.filemaker.com/app/answers/detail/a_id/13715/~/refining-find-requests-in-filemaker-pro-using-find-operators Enter Find mode Set Field ( d_prj::__project_id ; "*" & d_tmd_tmh::zd_time_dtl_prj_num & "*" ) Perform Find If nothing else, it gives you a double-check if the query seems to return ? or empty. beverly
Create an account or sign in to comment