B
Brigitte P
I'm trying to set a unique index in a Make Table Query. Here is the SQL Code
for my Make Table Query which works fine:
SELECT tblPatients.PatID AS RegNo, tblPatients.LName AS CliLName,
tblPatients.FName AS CliFName, IIf(tblPatients!Status="Open","Yes","No") AS
CliActive, tblPatients.Unit AS CliLivingArea, tblUnit.UnitName,
tblPatients.Birthdate AS CliDOB, tblPatients.Race AS CliRace,
tblRacePatients.Race, tblPatients.Sex AS CliSex, 729 AS AgencyCode INTO
CliCoreTable IN 'G:\Databases\BEClinical\ClientCoreData.mdb'
FROM tblRacePatients INNER JOIN (tblUnit INNER JOIN tblPatients ON
tblUnit.Unit = tblPatients.Unit) ON tblRacePatients.Code = tblPatients.Race;
I attempted to add before the ;
CREATE INDEX pat_id-ind ON CliCoreTable IN
'G:\Databases\BEClinical\ClientCoreData.mdb' ON (RegNo)
but get an error for the FROM clause.
The pat_id_ind is the index name and RegNo is the column name. The original
table has PatID as a unique value, thus the unique property is not
important.
I don't know much about SQL and don't know what's wrong. I need to create
this index, because the new table is part of a relationship with another
table and the relationship doesn't work without the index.
As always, thanks for any help.
Brigitte P
for my Make Table Query which works fine:
SELECT tblPatients.PatID AS RegNo, tblPatients.LName AS CliLName,
tblPatients.FName AS CliFName, IIf(tblPatients!Status="Open","Yes","No") AS
CliActive, tblPatients.Unit AS CliLivingArea, tblUnit.UnitName,
tblPatients.Birthdate AS CliDOB, tblPatients.Race AS CliRace,
tblRacePatients.Race, tblPatients.Sex AS CliSex, 729 AS AgencyCode INTO
CliCoreTable IN 'G:\Databases\BEClinical\ClientCoreData.mdb'
FROM tblRacePatients INNER JOIN (tblUnit INNER JOIN tblPatients ON
tblUnit.Unit = tblPatients.Unit) ON tblRacePatients.Code = tblPatients.Race;
I attempted to add before the ;
CREATE INDEX pat_id-ind ON CliCoreTable IN
'G:\Databases\BEClinical\ClientCoreData.mdb' ON (RegNo)
but get an error for the FROM clause.
The pat_id_ind is the index name and RegNo is the column name. The original
table has PatID as a unique value, thus the unique property is not
important.
I don't know much about SQL and don't know what's wrong. I need to create
this index, because the new table is part of a relationship with another
table and the relationship doesn't work without the index.
As always, thanks for any help.
Brigitte P