Avatar of morinia
moriniaFlag for United States of America asked on

Error in Make Table query in Access, but ignoring error table is created

I am getting the following error when creating a table in Microsoft Access.  The query works fine when it is not creating a table.  Also when I chose to ignore the error and create table, the table is created.  

Make Table Error.docx

MicrosoftMicrosoft Access

Avatar of undefined
Last Comment
Gustav Brock

8/22/2022 - Mon
slightwv (䄆 Netminder)

Seems you have one or more rows that doesn't have a name that follows:  letters <space> letters.

No idea how the query works without the INTO.  One or more of the first or last name fields should show an error.

I'm not an Access Expert so there may be a better way but this is what I came up with:
SELECT A1.ProviderID, A1.[Provider Name], Replace(A1.[Provider Last Name],',',' ') AS [Provider Last Name], A1.[Provider First Name], A1.Specialty, A1.NPI INTO Updated_Providers
	Providers.[Provider Name],
	IIf(InStr([Provider Name]," ")=0," ", Left([Provider Name],InStr([Provider Name]," "))) AS [Provider Last Name],
	IIf(InStrRev([Provider Name]," ")=0," ", Mid([Provider Name],InStrRev([Provider Name]," "))) AS [Provider First Name],
	IIf(Providers.Specialty Is null, "   ",Providers.Specialty) AS Specialty,
	IIf(Providers.NPI Is null,"    ",Providers.NPI) AS NPI
FROM Providers
) as A1;

Open in new window

Gustav Brock

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck