JSL-Abfragetabelle: Seltsames Ergebnis<BR />dirLoc=Pick Directory("Select a directory", "my directory");
fileList = Files In Directory(dirLoc);
dt1 = open(dirLoc || fileList[1]);
dt1 << Select Where( :Amount>=1000 );
x=dt1<<SUBSET></SUBSET>Greetings!
I am trying a simple query with a sample data file. The query returns right set of results if there is any record satisfying the condition in "Where" clause. But, in case, there exist no record satisfying the condition, it returns all the records where expected result is an empty set. Even, when I try to see how many records (N Row()) in the resultant set, it shows the count of total records.<BR /><BR />Thanks for any suggestion and please let me know if I am missing anything.
<LINGO-LABS id="lingo-labs-722288" slang="en-US" mode="CREATE"><LINGO-LABEL>Datenzugriff</LINGO-LABEL></LINGO-LABS>Betreff: JSL-Abfragetabelle: Seltsames ErgebnisHallo Jim,
Danke für deine schnelle Antwort. Eigentlich versuche ich, die Ergebnisse der Abfrage aus mehreren Tabellen zu verketten. Lassen Sie mich Ihren Vorschlag ausprobieren. Bitte teilen Sie uns mit, wenn Sie dazu eine Meinung haben.
Danke noch einmal!
Betreff: JSL-Abfragetabelle: Seltsames ErgebnisIch würde dies lösen, indem ich prüfe, ob Zeilen ausgewählt wurden, und wenn ja, dann die Teilmenge ausführe und wenn nicht, dann eine Nachricht ausdrucke.
dirLoc = Pick Directory( "Select a directory", "my directory" );
fileList = Files In Directory( dirLoc );
dt1 = Open( dirLoc || fileList[1] );
dt1 << Select Where( :Amount >= 1000 );
If( Length( dt1 << get selected rows ) > 0,
x = dt1 << Subset( Output Table Name( "T1" ) );
Close( dt1, NoSave );
Show( N Row( x ) );
x << Save( "my directory\t1.jmp" );
,
Show( "no rows selected" )
);