Make table query for empty records

Texas Longhorn

Active Member
Joined
Sep 30, 2003
Messages
492
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
 

Some videos you may like

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.

james_lankford

Well-known Member
Joined
Jan 11, 2009
Messages
1,178
Code:
select
  *
into
  new_table
from
  RawData
where 
(
  (
    len(trim(nz(PERMNO4, "")) ) = 0
  )
)
those are 2 double quotes
 
Last edited:

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,218
Office Version
  1. 365
Platform
  1. Windows
Try this.
Code:
SELECT RawData.PERMNO4, RawData.OtherData INTO new_table
FROM RawData
WHERE (((RawData.PERMNO4) Is Null));
 

Texas Longhorn

Active Member
Joined
Sep 30, 2003
Messages
492
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
 

Texas Longhorn

Active Member
Joined
Sep 30, 2003
Messages
492

ADVERTISEMENT

Norie - that's it! Thank you both very much for your help.
Bill
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,218
Office Version
  1. 365
Platform
  1. Windows
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);
 

Watch MrExcel Video

Forum statistics

Threads
1,122,499
Messages
5,596,515
Members
414,074
Latest member
Matthew Kakde

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
Top