I'm getting an error in this SQL!??!?

Results 1 to 3 of 3

Thread: I'm getting an error in this SQL!??!?

  1. #1
    Join Date
    Dec 1969

    Default I'm getting an error in this SQL!??!?

    INCORRECT SYNTAX NEAR KEYWORD WHERE.... I don&#039;t see it! Am I blind???? All field names, table name, etc were checked and are correct (although that would&#039;ve given me an entirely different error message anyway). Any clue folks?<BR><BR>SQL = "INSERT INTO tblAssignedEscalations (EGAStatus, Preferred, Recorded, DateRecorded) "<BR>SQL = SQL & " values (&#039;"&Request("EGAStatus")&"&#039;,&#039;"&Requ est("Preferred")&"&#039;,&#039;Yes&#039;,&#039;"&R equest("DateRecorded")&"&#039;) " <BR>SQL = SQL & "WHERE TicketNumber = &#039;"& Request("TicketNumber") &"&#039;"

  2. #2
    Join Date
    Dec 1969

    Default RE: I'm getting an error in this SQL!??!?

    It looks like you are trying to do and Update not an Insert. The syntax for and Update statemant goes something like this:<BR><BR>UPDATE Table SET Column1 = Value1, Column2 = Value2,... WHERE Column0 = &#060;record you want to update&#062;

  3. #3
    Join Date
    Dec 1969

    Default Matt is correct...

    You can&#039;t use a WHERE with an INSERT. Think about it: It doesn&#039;t make sense. You are putting in a *NEW* record...and you only want to put it in WHERE something is true??? Uh-uh. A new record goes where the system wants to put it.<BR><BR>Are you *really* tired tonight, Kristin? Getting too close to the deadline? (I assume this is K.H.)<BR><BR><BR><BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts