Normal Topic @XResultSetSearch ( ) (Read 800 times)
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
@XResultSetSearch ( )
Jun 29th, 2008 at 7:43pm
Print Post Print Post  
I want to get the resultset using @xResultSetSearch ( ) using two dates fields in the database.

The following reurns empty Handle.

var vRSHandle as Int
var vNoOfRecords as Int

vRSHandle = @XResultSetSearch(@FN, "Index", SEARCH_MODE_AND, SEARCH_SYNTAX_QA, "!DateEntered=>!DateLastVisit")
     if(vRSHandle > -1)
     {
           vNoOfRecords = @XResultSetTotal(vRSHandle)
           WriteLN ("Number of Records are " + @Str (vNoOfRecords) + ".")
     }

How do I get the resultSet handle referencing two fields in the database?

  
Back to top
 
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: @XResultSetSearch ( )
Reply #1 - Jun 29th, 2008 at 11:21pm
Print Post Print Post  
I could accomplish the above using loop to remove the current record from the the resultset that does not meet one of the condition referenced by the Database field but can it be achieved just by using proper @XResultSetSearch ( ) criteria?

var vRSHandle as int
var vNoOfRecords as int
var n as int

var vSuccess as Int



vRSHandle = @XResultSetSearch(@FN, "Index", SEARCH_MODE_AND, SEARCH_SYNTAX_QA, "!DateEntered=>{@Date - 180}", "!Action=Recalled")
     if(vRSHandle > -1)
     {
           vNoOfRecords = @XResultSetTotal(vRSHandle)
           For n = 1 to vNoOfRecords
                 xResultSetCurrentPosition (vRSHandle, n)
                 If @xResultSetValue (vRSHandle, "DateEntered") < @xResultSetValue (vRSHandle, "Date1") then
                       {
                             XResultSetRemoveRecord (vRSHandle)
                             n = n - 1
                             vNoOfRecords = vNoOfRecords - 1
                       }
           Next            
                 
           
           vSuccess = @xResultSetPrintReport ("Recall List", vRSHandle, Report_Mode_Print_Only_Preview)
           
           xResultSetClose (vRSHandle)
     }
  
Back to top
 
IP Logged