troubleshooting Question

Access Query to txt Two few paramters, expected 2

Avatar of aplona
aplonaFlag for United States of America asked on
Microsoft AccessMicrosoft DevelopmentSQL
59 Comments1 Solution600 ViewsLast Modified:
Hello All,
    This query runs great but i need to export it to a txt file.  When i do this i get an error stating Two few parameters, expected 2.  I must have the prompts for date range.  if i enter the date range directly into the query it will export to txt no problem.  I tried using a form to enter the date range but once again had the same error when trying to export to txt.  Here's the query:
Select PadT("Comp Name",20),
PadT("Comp Contact",58),
PadT("Phone Number",20),
PadT("Hosp",31), PadT("HospID",8),
PadT([Contact Info].Medicare_ID,12),
[Contact Info].Gender,
PadT([Contact Info].Zip,10),
IIf([Hosp_Visit_24]=True,"T","F") AS Hosp_Visit,
IIf([In_Home_Within 3]=True,"T","F") AS In_Home_Within,
IIf([In_Home_After_3]=True,"T","F") AS In_Home_After,
IIf([Tel_Within_1]=True,"T","F") AS Tel_Within,
IIf([Tel_After_1]=True,"T","F") AS Tel_After,
IIf([Other_Encounter]=True,"T","F") AS Other,
IIf([Planning_Support]=True,"T","F") AS Planning,
IIf([Med_Review]=True,"T","F") AS Med,
IIf([Counseling_Self_mgmt]=True,"T","F") AS Counseling,
IIf([Comm_Family]=True,"T","F") AS Comm,
IIf([Timely_Interactions]=True,"T","F") AS Timely,
IIf([Add_Health_Prob]=True,"T","F") AS Add_Health,
IIf([Patient_Services]=True,"T","F") AS Patient,
PadT("",200), PadT("",200), [Referral].EnrollmentDT, [tblPhonePillars (3)].Ph14Date, PadT("Amount",8)
FROM (((([tblPhonePillars (4)] INNER JOIN ([tblPhonePillars (3)] INNER JOIN [1)ID/Name/Goals]
ON [tblPhonePillars (3)].[StudyNo] = [1)ID/Name/Goals].[StudyNo]) ON [tblPhonePillars (4)].[StudyNo] = [1)ID/Name/Goals].[StudyNo]) INNER JOIN tblHomeVisitsPillars
ON [1)ID/Name/Goals].[StudyNo] = tblHomeVisitsPillars.[StudyNo]) INNER JOIN tblHospitalVisitsPillars
ON [1)ID/Name/Goals].[StudyNo] = tblHospitalVisitsPillars.[StudyNo]) INNER JOIN (([Contact Info] INNER JOIN Referral
ON [Contact Info].[StudyNo] = Referral.[StudyNo]) INNER JOIN [tblPhonePillars (2)]
ON Referral.[StudyNo] = [tblPhonePillars (2)].[StudyNo]) ON [1)ID/Name/Goals].[StudyNo] = Referral.[StudyNo]) INNER JOIN [tblPhonePillars (1)]
ON Referral.[StudyNo] = [tblPhonePillars (1)].[StudyNo]
WHERE (((Referral.EnrollmentDT) Between [From Date] And [To Date]))

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 59 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 59 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros