Query to Clean Up Imported File (1 Viewer)

diversoln

Registered User.
Local time
Today, 03:18
Joined
Oct 8, 2001
Messages
119
I've searched the forum and this must be so easy that no one has ever had to ask ....

I'm importing a text file as part of a macro and want to delete the first two rows (records) in the new table. The first row contains text and the second row is all blank. My "cleanup" query has no problem deleting the text record, but I can't seem to delete the blank rows. Any ideas ?

Here's the SQL for the cleanup query...

DELETE APWorklistTable.*, APWorklistTable.CASE, APWorklistTable.PATIENT, *
FROM APWorklistTable
WHERE (((APWorklistTable.CASE)="ACCESSION")) OR (((APWorklistTable.PATIENT)=IsNull([PATIENT])));
 

diversoln

Registered User.
Local time
Today, 03:18
Joined
Oct 8, 2001
Messages
119
Ok - found the problem - rather than IsNull([PATIENT]), I just needed Is Null with a space between "Is" and "Null" unlike the string function which is "IsNull".... go figure.

So the SQL looks like this:

DELETE APWorklistTable.*, APWorklistTable.CASE, APWorklistTable.PATIENT, *
FROM APWorklistTable
WHERE (((APWorklistTable.CASE)="ACCESSION")) OR (((APWorklistTable.PATIENT) Is Null));
 

Users who are viewing this thread

Top Bottom