Solved

sql error trying to change field

Posted on 2014-09-17
3
119 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
3 Comments
 
LVL 24

Accepted Solution

by:
Phillip Burton earned 500 total points
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks, I only use sql on occasion.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
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.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

728 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now