Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 132
  • Last Modified:

sql error trying to change field

What am I doing wrong in this code?  It says incorrect syntax near '=' by importstatus.

USE Data1;
SET ImportStatus = 'U';
from THeader
WHERE     (Invoice= 'credit') AND (DateTime >= '2014-09-9') AND (DateTime < '2014-09-15');
0
TomBalla
Asked:
TomBalla
1 Solution
 
Phillip BurtonCommented:
Several things :-) - Can you try the following (note the "GO", the "UPDATE" line, and the lack of a semi-colon at the end of the "SET" line:

Use Data1
GO
UPDATE THeader
SET ImportStatus = 'U'
WHERE     (Invoice= 'credit') AND ([DateTime] >= '20140909') AND ([DateTime] < '20140915');
0
 
Paul JacksonCommented:
try:

USE Data1;
Update THeader
Set ImportStatus = "U"
WHERE     (Invoice= 'credit') AND (DateTime >= '2014-09-9') AND (DateTime < '2014-09-15');
0
 
TomBallaAuthor Commented:
Thanks, I only use sql on occasion.
0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now