Using Microsoft Query in Excel 2003

pathen

New Member
Joined
Jan 16, 2009
Messages
10
I have a table with 47 columns and 62580 rows and I am trying to run Microsoft Query to weed out some records. The SQL query I am running gives me a a message that says "Too few parameters. Expected 1" The query is as follows:

SELECT AllAccts.Account, AllAccts.BR, AllAccts.Block, AllAccts.Lot, AllAccts.NAME_CUST, AllAccts.CL, AllAccts.AT, AllAccts.PA_Default, AllAccts.HDFC, AllAccts.TC, AllAccts.CD, AllAccts.AR, AllAccts.LPC, AllAccts.UTIL, AllAccts.DELQ30, AllAccts.DELQ60, AllAccts.DELQ90, AllAccts.DELQ180, AllAccts.DELQ270, AllAccts.DELQ365, AllAccts.DELQ2YR, AllAccts.DELQ3YR, AllAccts.DELQ4YR, AllAccts.DELQ5YR, AllAccts.LAST_PAY_DATE, AllAccts.LAST_PAY_AMT, AllAccts.`SA Number`, AllAccts.`SA Street`, AllAccts.`SA Suffix`, AllAccts.SAZIP, AllAccts.MAILING_ADDR, AllAccts.MAILING_CITY, AllAccts.MAILI, AllAccts.ALERT_ADDR, AllAccts.ALERT_CITY, AllAccts.ALERT_ZIP, AllAccts.SERV_ADDR, AllAccts.SERV_CITY, AllAccts.SERV_STATE, AllAccts.SERV_ZIP, AllAccts.MAILING_ADDR1, AllAccts.MAILING_CITY1, AllAccts.MA, AllAccts.MAILI1, format(AllAccts.SERV_ADDR_PHONE,'@@@-@@@-@@@@') AS 'serv_phone', AllAccts.SERV_ADDR_PHONE, AllAccts.CUST_PHONE_, AllAccts.SPOUSE_P
FROM `Q:\RobsFolder\RHRecentDelq -- original accts summary`.AllAccts AllAccts
WHERE (AllAccts.DELQ30>=500 And AllAccts.DELQ30<=500000) AND (AllAccts.HDFC<>'20000') AND (AllAccts.SERV_ADDR_PHONE<>0) AND (AllAccts.CL Not Between 'T1' And 'Z9' And AllAccts.CL Not Between 'I1' And 'I9' And AllAccts.CL Not Between 'M1' And 'M9' And AllAccts.CL Not Between 'N1' And 'N9' And AllAccts.CL Not Between 'P1' And 'P9' And AllAccts.CL Not Between 'Q1' And 'Q9') AND (len(SERV_ADDR_PHONE)=10)

Could anyone give me some advice on debugging this SQL query? The strange thing is I ran it last week on a similar table and I did not have a problem. I'll be very thankful for any insight.
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

Forum statistics

Threads
1,221,531
Messages
6,160,366
Members
451,642
Latest member
mirofa

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