Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need some help on this sql code

Status
Not open for further replies.

warmunger

Technical User
Jul 15, 2002
42
ZA
I get a syntax error in the last line of this code


INSERT INTO malazacompleted ( JOBCARDSID, [DATE], ContactFirstName, ContactLastName, CompanyName, Department, ADDRESS, PostalCode, PhoneNumber, MobilePhoneNumber, PurchaseOrderNumber, SerialNumber, PROBLEM, FREPORT, LABOUR, CHARGE, INVNO )
SELECT MALAZA.JOBCARDSID, MALAZA.DATE, MALAZA.ContactFirstName, MALAZA.ContactLastName, MALAZA.CompanyName, MALAZA.Department, MALAZA.ADDRESS, MALAZA.PostalCode, MALAZA.PhoneNumber, MALAZA.MobilePhoneNumber, MALAZA.PurchaseOrderNumber, MALAZA.SerialNumber, MALAZA.PROBLEM, MALAZA.FREPORT, MALAZA.LABOUR, MALAZA.CHARGE, MALAZA.INVNO
FROM MALAZA
WHERE (((MALAZA.JOBCARDSID)=[Forms]![MALAZA]![JOBCARDSID]));

please i need some help!!!


 
Unless I'm being very blind, I can't see anything wrong. What's the code immediately around this bit?

Cheers,

Pete
 
It tells the procedure to go and look at the jobcardsid value. Jobcardsid is the primary key. This allows you to copy specific rows in a table to another table instead of the whole table.

The data type is a number!
 
Petemush i see you also replied to my other thread. This is the sql code for that query.Its works fine if I use it as a query but I want to make this query into a stored procedure now!!!

 
Here is the specific error code I get

error 170: Line 14 incorrect syntax near "!"

Line 14 Being the last line in the code

Is there another way of doing something simular!!
 
[Forms]![MALAZA]![JOBCARDSID]
I am assuming that the form you are referencing is named MALAZA and the control is name JOBCARDSID, is that the case? If it is, just as an aside, it's terribly confusing to not use standard naming conventions in your apps. See
thread181-293590.
 
Can you post the entire procedure? Not just the SQL bit? Cheers!

Pete
 
call me clueless... what's the ";" at the end for? does that change anything when trying to save it as a procedure? (i know i didn't have one on mine sql string)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top