Hi all,

I'm having a problem with a query and I think it might
be Access-related. Here's the text:

<cfquery name="PermitSearch"
datasource="CMISPersonnel">
Select FirstName, MiddleInitial, LastName, Zip,
SpaceNumber, TagNumber, DecalNumber, PermitNumber
from Personnel, Vehicles
where Personnel.PersonnelKey = Vehicles.PersonnelKey
<!-- Search by last name -->
  <cfif form.LastNameSearch is not "">
  and LastName like '%#form.LastNameSearch#%'
  </cfif>
  <!-- Search by zip code -->
  <cfif form.ZipCodeSearch is not "">
  and Zip = #form.ZipCodeSearch#
  </cfif>
  <!-- Search by permit number -->
  <cfif form.PermitNbrSearch is not "">
  and PermitNumber = #form.PermitNbrSearch#
  </cfif>
  <!-- Search by  assigned  parking space number -->
  <cfif form.SpaceNbrSearch is not "">
  and SpaceNumber = #form.SpaceNbrSearch#
  </cfif>
  <!-- Search by car license  plate -->
  <cfif form.TagSearch is not "">
  and TagNumber = #form.TagSearch#
  </cfif>
  <!-- Search by decal number -->
  <cfif form.DecalSearch is not "">
  and DecalNumber = #form.DecalSearch#
  </cfif>
order by LastName
</cfquery>

Here's the error message:

Invalid use of '.', '!', or '()'. in query _expression_
'Personnel.PersonnelKey = Vehicles.PersonnelKey '.

I've Googled the error message and all the results
were from Access users, so I'm going to assume that
it's some Access weirdness. Any Access experts out
there? I'm using Access 2000 and CFMX. I've tried
replacing the periods in 'Personnel.PersonnelKey =
Vehicles.PersonnelKey' with exclamation points but it
didn't make a difference. Another suggestion was to
change one of the field names so that the name
wouldn't appear twice, i.e., change one of the
"PersonnelKey" field names in one of the tables, but I
won't be allowed to make that kind of change to the
database.

Any ideas about what I could do?

Thanks,

Laura
===========================
Laura Schlee
DML Associates
work 202 685 1360
cell 703 622 0363

__________________________________
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
http://launch.yahoo.com/promos/britneyspears/
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to