Solved

sql error trying to change field

Posted on 2014-09-17
3
122 Views
Last Modified: 2014-09-17
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
Comment
Question by:TomBalla
[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
3 Comments
 
LVL 24

Accepted Solution

by:
Phillip Burton earned 500 total points
ID: 40328366
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
 
LVL 29

Expert Comment

by:Paul Jackson
ID: 40328374
try:

USE Data1;
Update THeader
Set ImportStatus = "U"
WHERE     (Invoice= 'credit') AND (DateTime >= '2014-09-9') AND (DateTime < '2014-09-15');
0
 

Author Comment

by:TomBalla
ID: 40328375
Thanks, I only use sql on occasion.
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

Suggested Solutions

Title # Comments Views Activity
unable to reinstall SCVMM 2012 R2 - SQL errors. 5 41
Find unused columns in a table 12 74
Open A Form without Loading All the Records of Its Recordsource 6 46
SQL Syntax 6 41
Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

733 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