Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

asp

Posted on 1999-07-02
4
Medium Priority
?
209 Views
Last Modified: 2010-05-02

Hi-

I have an asp where I am trying to do a search.  Example, I have a form in which you can search for all customers in the state of WA and whom have Blue Shield insurance or whatever you want to search for.  

The search needs to look in two tables, therefore I am doing a join shown below.  I cannot get this to work.  It works fine until I throw in the join.  Can anyone help?  thanks


MyQuery = "select c.customerid, customer.firstName, customer.lastName, customer.address1, customer.city, customer.state, insurance.insurancename from customer, insurace where customer.customerid = insurance.customerid " & csSearch & "order by lastName, firstName, state, city"
0
Comment
Question by:mmhd
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 4

Expert Comment

by:siabod
ID: 1521634
What's the error you're getting ?
0
 

Expert Comment

by:chittamuru
ID: 1521635
What is c.customerid? You haven't declared any aliases for any of the tables. Find out, whether this is giving error? What is csSearch? Why are you using "&" before order by?
0
 

Author Comment

by:mmhd
ID: 1521636

CSSearch is the criteria that is taken from the form, querystring.

This is the erorr:

Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near 'firstName'.


MyQuery = "select customer.customerid, customer.firstName, customer.lastName, customer.address1, customer.city, customer.state, insurance.insurancename from customer, insurace where customer.customerid = insurance.customerid " & csSearch & "order by lastName, firstName, state, city"
0
 
LVL 1

Accepted Solution

by:
poneill011098 earned 200 total points
ID: 1521637
Your SQL should read:

MyQuery = "select customer.customerid, customer.firstName, customer.lastName, customer.address1, customer.city, customer.state, insurance.insurancename from customer, insurance where customer.customerid = insurance.customerid " & csSearch & "order by lastName, firstName, state, city"

There was an "n" missing from your Insurance table name
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question