Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 3114 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted (edited)

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 by oakbridge
Posted wrong block of code
Posted

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

This topic is 3114 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.