Make table query for empty records

Texas Longhorn

Active Member
Joined
Sep 30, 2003
Messages
493
Hi all,

I'm new to Access, and I'm having trouble getting a make table query to work. I have a database with one table (RawData, which is quite large). One of the fields, PERMNO4, contains some records that are (or at appear to be) blank/empty. I am trying to make a new table with all of the fields in RawData but with the criterion that PERMNO4 be blank. To do this, I have gone into Create query in Design view, chosen Make Table Query in the query drop down menu, selected RawData, dragged all of the fields down, and then in Criteria under PERMNO4 I typed IsEmpty([PERMNO4]). I also tried IsNull. Both of these create a table with zero records. Any tips would be greatly appreciated.

Thanks,
Bill
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Code:
select
  *
into
  new_table
from
  RawData
where 
(
  (
    len(trim(nz(PERMNO4, "")) ) = 0
  )
)
those are 2 double quotes
 
Last edited:
Upvote 0
Try this.
Code:
SELECT RawData.PERMNO4, RawData.OtherData INTO new_table
FROM RawData
WHERE (((RawData.PERMNO4) Is Null));
 
Upvote 0
James - thanks for the reply. I am getting the error: Data type mismatch in criteria expression. I should have mentioned that PERMNO4 is stored as Text.

Thanks,

Bill
 
Upvote 0
And if you want to deal with spaces just add Trim.:)

SELECT [RawData].[PERMNO4], [RawData].[OtherData] INTO new_table
FROM RawData
WHERE ((Trim([RawData].[PERMNO4])) Is Null);
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,394
Members
448,957
Latest member
Hat4Life

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top