Solved

sql error trying to change field

Posted on 2014-09-17
3
120 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
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
sql help 8 55
MS SQL Server Management Studio, Save query 2 18
Attaching Database Failed ? 3 39
Refresh Dev server with Production database 8 27
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…
Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
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.
Viewers will learn how the fundamental information of how to create a table.

785 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