Welcome! Log In Create A New Profile

Advanced

Search in Query

Posted by Damian 
Damian
Search in Query
September 11, 2008 07:33PM
Hi,

I have created a Query, and I need to create a search to locate a certain value

My Query is:

HExecuteQuery(MyQuery,hQueryDefault,MyID)


And now I use a Hfilter

SearchKey=HFilter(MyQuery,"MyQuery.MyValue =" +ValueX)
HReadFirst(QRY_MyQuery, SearchKey)


This filter always returns the same value to me and this is not correct I have different values

somebody has some idea of how is due to correctly make the search in a Query?

Thanks in advance
Regards
/Damian
Jeff Graham
Re: Search in Query
September 11, 2008 07:43PM
I think you need to check the format of the HFilter:
<Result> = HFilter(<File Name>, <Name of Search Key>, <Lower Bound> [, <Upper Bound> [, <Selection Condition>]])

We use the HFilter extensively on queries and the work fine. You seem to be missing the search key field.

Jeff
Al
Re: Search in Query
September 12, 2008 03:46AM
Hello Damian

I always find it good practice with HFilter() to let the wizard build the search code.

The other option if MyID is a key field is to just use hfilter() on the file without the query. It may be quicker.

Regards
Al
DW
Re: Search in Query
September 12, 2008 02:25PM
Hello Damian,

SearchKey=HFilter(MyQuery,"MyQuery.MyValue =" +ValueX)
HReadFirst(QRY_MyQuery, SearchKey)

The sought value must have a ' if front and a ' in the back

SearchKey=HFilter("MyQuery,MyQuery.MyValue = '12' ")

So if you are going to use a variable to search a string it should look like this:

SearchKey=HFilter(MyQuery,"PO_Number ~] "+ "'" + EDT_Quick_Search_Page1 + "'")

If you are searching on a number like an ID field

HFilter(MyQuery,ID,SoughtID) // this uses the lower bound upper bound good to find things in ranges

Dennis
Damian
Re: Search in Query
September 12, 2008 06:37PM

Jeff Graham, Al ,Dennis

Thank you for your answer.

Damian
issah
Re: Search in Query
September 13, 2008 12:33PM
Saw your post late.
Have you considered:

MyQuery.MyID=MyValue
HExecuteQuery(MyQuery,hQueryDefault,MyID)
//
HReadFirst(MyQuery)
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: