Data Exceptions Split

B

Bateman28

Hi

I have a import routine that imports a monthly data file into my database.
As part of the routine the data is imported into a Temp Table and then split,
firstly all the records are sent to an Exceptions table. I then move all the
files from the exceptions table that are going to worked on, by transferring
them to the Main Data Table where all the files are set into the specific
regions that the records belongs to. Once all the records have been
transferred successfully the Temp Table is cleared to save space.

I have this same routine working for 3 other database systems and I’ve never
had any issues with the data. With my new system I have specific records
that i need to keep in the Exceptions table but when i run a query to keep
specific items within the exceptions table it will only keep the first item
and nothing else, like in this example when i run the query it will only keep
the records "Proprietor" and delete everything else. Here is the of the code
i have been using.

DELETE OriginalDataExceptions.[Company Name]
FROM OriginalDataExceptions
WHERE (((OriginalDataExceptions.[Company Name]) Not Like "*Proprietor*"))
And (((OriginalDataExceptions.[Company Name]) Not Like "*Drive*")) And
(((OriginalDataExceptions.[Company Name]) Not Like "*Auction*"));

Any help would be great.
 
K

kc-mass

Hi,

In your where clause replace your "AND"s with "OR"s.

What your current clause says is that all the conditions
have to be true to retain the record. I think you mean
if any condition is true, keep it.

Regards

Kevin
 
B

Bateman28

I tried the "Or" instead of the "And" statement within my query before I'd
had chance to read your reply and it worked,

But i am greatfull for your response

Nick

kc-mass said:
Hi,

In your where clause replace your "AND"s with "OR"s.

What your current clause says is that all the conditions
have to be true to retain the record. I think you mean
if any condition is true, keep it.

Regards

Kevin


Bateman28 said:
Hi

I have a import routine that imports a monthly data file into my database.
As part of the routine the data is imported into a Temp Table and then
split,
firstly all the records are sent to an Exceptions table. I then move all
the
files from the exceptions table that are going to worked on, by
transferring
them to the Main Data Table where all the files are set into the specific
regions that the records belongs to. Once all the records have been
transferred successfully the Temp Table is cleared to save space.

I have this same routine working for 3 other database systems and I've
never
had any issues with the data. With my new system I have specific records
that i need to keep in the Exceptions table but when i run a query to keep
specific items within the exceptions table it will only keep the first
item
and nothing else, like in this example when i run the query it will only
keep
the records "Proprietor" and delete everything else. Here is the of the
code
i have been using.

DELETE OriginalDataExceptions.[Company Name]
FROM OriginalDataExceptions
WHERE (((OriginalDataExceptions.[Company Name]) Not Like "*Proprietor*"))
And (((OriginalDataExceptions.[Company Name]) Not Like "*Drive*")) And
(((OriginalDataExceptions.[Company Name]) Not Like "*Auction*"));

Any help would be great.


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top