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

x
?
Solved

sql error trying to change field

Posted on 2014-09-17
3
Medium Priority
?
128 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 2000 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

What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
Windocks is an independent port of Docker's open source to Windows.   This article introduces the use of SQL Server in containers, with integrated support of SQL Server database cloning.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

722 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