Make Query with Parameter Issues

  • Thread starter Thread starter Marsha
  • Start date Start date
M

Marsha

I'm trying to run a make query that I just created, and it keep asking
me for parameters? I didn't specificy any parameters, though I did
specify a great than (>0) requirement. Maybe I wrote this in wrong.
Can anyone perhaps take a look at the sql language and endeavor a guess
as to what I may be doing wrong? (Sorry it's a bit long)

SELECT DISTINCT Trim([NF06-Scantest1].[SSN]) AS SSN1,
Trim([NF06-Scantest1].[VisitDate]) AS VisitDate1,
Trim([NF06-Scantest5].[VisitType]) AS VisitType1,
Trim([NF06-Scantest6].[MedicationAdjustment]) AS MedAdj,
Trim([NF06-Scantest2].[Residence]) AS Residence1,
Trim([NF06-Scantest5].[PrimaryDiagnosis]) AS Diagnosis,
IIf([NF06-ScanTest8].[HoehnandYahr]>0,[NF06-Scantest8].[HoehnandYahr],"
") AS HoehnAndYahrScale,
IIf([NF06-Scantest8].[SchwabandEngland]>0,[NF06-Scantest8].[SchwabandEngland],"
") AS SchwabandEnglandScale, [NF06-Scantest2].PainIndex AS PainIndex,
IIf([NF06-Scantest2].[Memory],[NF06-Scantest2].[Memory]) AS UPDRS1,
IIf([NF06-ScanTest2].[Hallucinations],[NF06-Scantest2].[Hallucinations])
AS UPDRS2,
IIf([NF06-ScanTest2].[SadDepressed],[NF06-Scantest2].[SadDepressed]) AS
UPDRS3, IIf([NF06-Scantest2].[Speech],[NF06-Scantest2].[Speech]) AS
UPDRS5, IIf([NF06-Scantest3].[Falls],[NF06-Scantest3].[Falls]) AS
UPDRS7,
IIf([NF06-Scantest3].[AbilitytoWalk],[NF06-Scantest3].[AbilitytoWalk])
AS UPDRS13,
IIf([NF06-Scantest7].[Dyskinesias],[NF06-Scantest7].[Dyskinesias]) AS
UPDRS15,
IIf([NF06-Scantest7].[DisablingDyskinesias],[NF06-Scantest7].[DisablingDyskinesias])
AS UPDRS33,
IIf([NF06-Scantest7].[PercentOff],[NF06-Scantest7].[PercentOff]) AS
UPDRS39,
IIf([NF06-Scantest7].[SleepProblems],[NF06-Scantest7].[SleepProblems])
AS UPDRS41, IIf([NF06-Scantest7].[Dizzy],[NF06-Scantest7].[Dizzy]) AS
UPDRS42, Trim([NF06-Scantest6].[AmantadineCR]) AS CurAmantadine,
Trim([NF06-Scantest6].[ApomorphineCR]) AS CurApomorphine,
([NF06-Scantest6].[BotulinumACr]) AS CurBotulinumACr,
Trim([NF06-Scantest6].[BotulinumBCr]) AS CurBotulinumB,
Trim([NF06-Scantest6].[ClozapineCr]) AS CurClozapine,
Trim([NF06-Scantest6].[FludrocortisoneCr]) AS CurFludrocortisone,
Trim([NF06-Scantest6].[MidodrineCr]) AS CurMidodrine,
Trim([NF06-Scantest6].[QuetiapineCr]) AS CurQuetiapine,
Trim([NF06-Scantest6].[CitalopramCr]) AS CurCitalopram,
Trim([NF06-Scantest6].[FlueoxetineCR]) AS CurFlueoxetine,
Trim([NF06-Scantest6].[FluvoxamineCr]) AS CurFluvoxamine,
Trim([NF06-Scantest6].[BenztropineCr]) AS CurBenztropine,
Trim([NF06-Scantest6].[PramipexoleCr]) AS CurPramipexole,
Trim([NF06-Scantest6].[SelegilineCr]) AS CurSelegiline,
Trim([NF06-Scantest6].[TrihexyphenidylCr]) AS CurTrihexyphenidy,
Trim([NF06-Scantest6].[ParoxetineCr]) AS CurParoxetine,
Trim([NF06-Scantest6].[SertralineCr]) AS CurSertraline,
Trim([NF06-Scantest6].[Levodopa-carbidopa-CRCr]) AS
[CurLevodopa-carbidopa-CR], Trim([NF06-Scantest6].[RopiniroleCr]) AS
CurRopinirole, Trim([NF06-Scantest6].[TolcaponeCr]) AS CurTolcapone,
Trim([NF06-Scantest6].[Levodopa-carbidopa-entacaponeCr]) AS
[CurLevodopa-carbidopa-entacapone],
Trim([NF06-Scantest6].[EntacaponeCr]) AS CurEntacapone,
Trim([NF06-Scantest6].[MemantineCr]) AS CurMemantine,
Trim([NF06-Scantest6].[RivastigmineCr]) AS CurRivastigmine,
Trim([NF06-Scantest6].[GalantamineCr]) AS CurGalantamine,
Trim([NF06-Scantest6].[DonepezilCr]) AS CurDonepezil,
[NF06-Scantest6].Other1Cr, [NF06-Scantest6].Other2Cr,
[NF06-Scantest6].Other3Cr,
[memory]+[VividDreamsHallucinations]+[Depressed] AS UPDRSI,
[Speach]+[Swallowing]+[Falling]+[Walking] AS UPDRSII,
[Dyskinesias]+[HowDisablinDyskinesias]+[pERIODOFDAYOFF] AS UPDRSIII,
[SleepProblems]+[LightheadedDizzy] AS UPDRSIV, [NF06-Scantest3].[EQ-5D]
INTO Visit
FROM ((((((([NF06-Scantest1] INNER JOIN [NF06-Scantest2] ON
([NF06-Scantest1].VisitDate = [NF06-Scantest2].VisitDate) AND
([NF06-Scantest1].SSN = [NF06-Scantest2].SSN)) INNER JOIN
[NF06-Scantest3] ON ([NF06-Scantest1].VisitDate =
[NF06-Scantest3].VisitDate) AND ([NF06-Scantest1].SSN =
[NF06-Scantest3].SSN)) INNER JOIN [NF06-Scantest4] ON
([NF06-Scantest1].VisitDate = [NF06-Scantest4].VisitDate) AND
([NF06-Scantest1].SSN = [NF06-Scantest4].SSN)) INNER JOIN
[NF06-Scantest5] ON ([NF06-Scantest1].VisitDate =
[NF06-Scantest5].VisitDate) AND ([NF06-Scantest1].SSN =
[NF06-Scantest5].SSN)) INNER JOIN [NF06-Scantest6] ON
([NF06-Scantest1].VisitDate = [NF06-Scantest6].VisitDate) AND
([NF06-Scantest1].SSN = [NF06-Scantest6].SSN)) INNER JOIN
[NF06-Scantest7] ON ([NF06-Scantest1].VisitDate =
[NF06-Scantest7].VisitDate) AND ([NF06-Scantest1].SSN =
[NF06-Scantest7].SSN)) INNER JOIN [NF06-Scantest8] ON
([NF06-Scantest1].VisitDate = [NF06-Scantest8].VisitDate) AND
([NF06-Scantest1].SSN = [NF06-Scantest8].SSN)) INNER JOIN
[NF06-Scantest9] ON ([NF06-Scantest1].VisitDate =
[NF06-Scantest9].VisitDate) AND ([NF06-Scantest1].SSN =
[NF06-Scantest9].SSN)
ORDER BY Trim([NF06-Scantest1].[SSN]);
 
Even if you have no parameters, Access will prompt you if you have an
expression that it cannot resolve to one of the source tables. For example,
in your column defined as :
[memory]+[VividDreamsHallucinations]+[Depressed] AS UPDRSI

if Access doesn't can't find a field called [memory] in one of the tables,
it will prompt you for it when you run the query.

What is it prompting you for? Look in the query for whatever the prompt is
and I think you'll find the answer.

Barry

Marsha said:
I'm trying to run a make query that I just created, and it keep asking
me for parameters? I didn't specificy any parameters, though I did
specify a great than (>0) requirement. Maybe I wrote this in wrong.
Can anyone perhaps take a look at the sql language and endeavor a guess
as to what I may be doing wrong? (Sorry it's a bit long)

SELECT DISTINCT Trim([NF06-Scantest1].[SSN]) AS SSN1,
Trim([NF06-Scantest1].[VisitDate]) AS VisitDate1,
Trim([NF06-Scantest5].[VisitType]) AS VisitType1,
Trim([NF06-Scantest6].[MedicationAdjustment]) AS MedAdj,
Trim([NF06-Scantest2].[Residence]) AS Residence1,
Trim([NF06-Scantest5].[PrimaryDiagnosis]) AS Diagnosis,
IIf([NF06-ScanTest8].[HoehnandYahr]>0,[NF06-Scantest8].[HoehnandYahr],"
") AS HoehnAndYahrScale,
IIf([NF06-Scantest8].[SchwabandEngland]>0,[NF06-Scantest8].[SchwabandEngland],"
") AS SchwabandEnglandScale, [NF06-Scantest2].PainIndex AS PainIndex,
IIf([NF06-Scantest2].[Memory],[NF06-Scantest2].[Memory]) AS UPDRS1,
IIf([NF06-ScanTest2].[Hallucinations],[NF06-Scantest2].[Hallucinations])
AS UPDRS2,
IIf([NF06-ScanTest2].[SadDepressed],[NF06-Scantest2].[SadDepressed]) AS
UPDRS3, IIf([NF06-Scantest2].[Speech],[NF06-Scantest2].[Speech]) AS
UPDRS5, IIf([NF06-Scantest3].[Falls],[NF06-Scantest3].[Falls]) AS
UPDRS7,
IIf([NF06-Scantest3].[AbilitytoWalk],[NF06-Scantest3].[AbilitytoWalk])
AS UPDRS13,
IIf([NF06-Scantest7].[Dyskinesias],[NF06-Scantest7].[Dyskinesias]) AS
UPDRS15,
IIf([NF06-Scantest7].[DisablingDyskinesias],[NF06-Scantest7].[DisablingDyskinesias])
AS UPDRS33,
IIf([NF06-Scantest7].[PercentOff],[NF06-Scantest7].[PercentOff]) AS
UPDRS39,
IIf([NF06-Scantest7].[SleepProblems],[NF06-Scantest7].[SleepProblems])
AS UPDRS41, IIf([NF06-Scantest7].[Dizzy],[NF06-Scantest7].[Dizzy]) AS
UPDRS42, Trim([NF06-Scantest6].[AmantadineCR]) AS CurAmantadine,
Trim([NF06-Scantest6].[ApomorphineCR]) AS CurApomorphine,
([NF06-Scantest6].[BotulinumACr]) AS CurBotulinumACr,
Trim([NF06-Scantest6].[BotulinumBCr]) AS CurBotulinumB,
Trim([NF06-Scantest6].[ClozapineCr]) AS CurClozapine,
Trim([NF06-Scantest6].[FludrocortisoneCr]) AS CurFludrocortisone,
Trim([NF06-Scantest6].[MidodrineCr]) AS CurMidodrine,
Trim([NF06-Scantest6].[QuetiapineCr]) AS CurQuetiapine,
Trim([NF06-Scantest6].[CitalopramCr]) AS CurCitalopram,
Trim([NF06-Scantest6].[FlueoxetineCR]) AS CurFlueoxetine,
Trim([NF06-Scantest6].[FluvoxamineCr]) AS CurFluvoxamine,
Trim([NF06-Scantest6].[BenztropineCr]) AS CurBenztropine,
Trim([NF06-Scantest6].[PramipexoleCr]) AS CurPramipexole,
Trim([NF06-Scantest6].[SelegilineCr]) AS CurSelegiline,
Trim([NF06-Scantest6].[TrihexyphenidylCr]) AS CurTrihexyphenidy,
Trim([NF06-Scantest6].[ParoxetineCr]) AS CurParoxetine,
Trim([NF06-Scantest6].[SertralineCr]) AS CurSertraline,
Trim([NF06-Scantest6].[Levodopa-carbidopa-CRCr]) AS
[CurLevodopa-carbidopa-CR], Trim([NF06-Scantest6].[RopiniroleCr]) AS
CurRopinirole, Trim([NF06-Scantest6].[TolcaponeCr]) AS CurTolcapone,
Trim([NF06-Scantest6].[Levodopa-carbidopa-entacaponeCr]) AS
[CurLevodopa-carbidopa-entacapone],
Trim([NF06-Scantest6].[EntacaponeCr]) AS CurEntacapone,
Trim([NF06-Scantest6].[MemantineCr]) AS CurMemantine,
Trim([NF06-Scantest6].[RivastigmineCr]) AS CurRivastigmine,
Trim([NF06-Scantest6].[GalantamineCr]) AS CurGalantamine,
Trim([NF06-Scantest6].[DonepezilCr]) AS CurDonepezil,
[NF06-Scantest6].Other1Cr, [NF06-Scantest6].Other2Cr,
[NF06-Scantest6].Other3Cr,
[memory]+[VividDreamsHallucinations]+[Depressed] AS UPDRSI,
[Speach]+[Swallowing]+[Falling]+[Walking] AS UPDRSII,
[Dyskinesias]+[HowDisablinDyskinesias]+[pERIODOFDAYOFF] AS UPDRSIII,
[SleepProblems]+[LightheadedDizzy] AS UPDRSIV, [NF06-Scantest3].[EQ-5D]
INTO Visit
FROM ((((((([NF06-Scantest1] INNER JOIN [NF06-Scantest2] ON
([NF06-Scantest1].VisitDate = [NF06-Scantest2].VisitDate) AND
([NF06-Scantest1].SSN = [NF06-Scantest2].SSN)) INNER JOIN
[NF06-Scantest3] ON ([NF06-Scantest1].VisitDate =
[NF06-Scantest3].VisitDate) AND ([NF06-Scantest1].SSN =
[NF06-Scantest3].SSN)) INNER JOIN [NF06-Scantest4] ON
([NF06-Scantest1].VisitDate = [NF06-Scantest4].VisitDate) AND
([NF06-Scantest1].SSN = [NF06-Scantest4].SSN)) INNER JOIN
[NF06-Scantest5] ON ([NF06-Scantest1].VisitDate =
[NF06-Scantest5].VisitDate) AND ([NF06-Scantest1].SSN =
[NF06-Scantest5].SSN)) INNER JOIN [NF06-Scantest6] ON
([NF06-Scantest1].VisitDate = [NF06-Scantest6].VisitDate) AND
([NF06-Scantest1].SSN = [NF06-Scantest6].SSN)) INNER JOIN
[NF06-Scantest7] ON ([NF06-Scantest1].VisitDate =
[NF06-Scantest7].VisitDate) AND ([NF06-Scantest1].SSN =
[NF06-Scantest7].SSN)) INNER JOIN [NF06-Scantest8] ON
([NF06-Scantest1].VisitDate = [NF06-Scantest8].VisitDate) AND
([NF06-Scantest1].SSN = [NF06-Scantest8].SSN)) INNER JOIN
[NF06-Scantest9] ON ([NF06-Scantest1].VisitDate =
[NF06-Scantest9].VisitDate) AND ([NF06-Scantest1].SSN =
[NF06-Scantest9].SSN)
ORDER BY Trim([NF06-Scantest1].[SSN]);
 
Back
Top