vRS = @XResultSetSearch(@FN, "SERVICES DATA", SEARCH_MODE_AND, SEARCH_SYNTAX_QA, "!SDAno=" + DAno,"!YEARa=" + YEAR2)
The LE’s DAno & YEAR2 in the MAIN database are both bound to type TEXT.
The LE’s SDAno & YEARa in the SERVICES DATA database are both bound to type TEXT.
Programming runs on ON ELEMENT EXIT on the YEAR2 LE.
If YEAR2 contains the correct year, i.e., 2011, vCount = 1, and the result is correct.
If YEAR2 contains a letter or a number but not 2011, vCount = 0, and it correctly returns nothing.
If YEAR2 is empty, vCount equals the number of records in the SERVICES DATA base, and it incorrectly returns the first record found in the SERVICES DATA database.
When I make YEAR2 a variable, vYEAR2, and declare it as INT, the code works except if YEARa is a letter rather than a number.
I thought that in order to get a result, both conditions have to be met. For example, if I set SDAno to 4444, and YEARa is blank, and there are no records like that, why should vCount not equal 0?
Does this mean that a number in a text box is still a number?
What do I have to do so that numbers or text can be placed in the YEARa LE in the SERVICES DATA database and the @XResultSetSearch finds them, but when YEAR2 is left empty it returns nothing,(or vCount = 0) rather than the first SERVICES DATA record?
What am I missing, thanks for help with this.
|