472,335 Members | 1,710 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,335 software developers and data experts.

SQL UPDATE command for updating DATE

Hi
how can i update the DATE field in a table
my code is

UPDATE FACTORYORDER
SET DUEDATE =7/30/2001
WHERE olddate =1/6/2004

showing error
suggest me where i need to change
Jun 26 '07 #1
8 106231
DeMan
1,806 1GB
Hi there, just moving your post to one of the SQL forums, where the experts will be far better qualified to address your query. A link to this thread will be left in the introductions this time, however in future you can use the blue bar above to navigate through the forums
Jun 26 '07 #2
r035198x
13,262 8TB
Hi
how can i update the DATE field in a table
my code is

UPDATE FACTORYORDER
SET DUEDATE =7/30/2001
WHERE olddate =1/6/2004

showing error
suggest me where i need to change
Hi and Welcome to TSDN. Hope you'll have a great time here.
You should have specified the error that you're getting and posted this in a relevant database forum.
Which database are you using e.g with MySQL you'd have to do

Expand|Select|Wrap|Line Numbers
  1.  UPDATE FACTORYORDER 
  2. SET DUEDATE ="2001-301-07"
  3. WHERE olddate ="2004-06-01"
Jun 26 '07 #3
Hi
im updating the database using TOAD for Oracle freeware
code :
UPDATE FACTORYORDER
SET DUEDATE ="2001-30-07"
WHERE olddate ="2004-06-01";

error is : 2004-06-01 is invalllid identifier
Jun 26 '07 #4
r035198x
13,262 8TB
Hi
im updating the database using TOAD for Oracle freeware
code :
UPDATE FACTORYORDER
SET DUEDATE ="2001-30-07"
WHERE olddate ="2004-06-01";

error is : 2004-06-01 is invalllid identifier
In that case I'll move this to the Oracle forum .
Jun 26 '07 #5
debasisdas
8,127 Expert 4TB
Hi
im updating the database using TOAD for Oracle freeware
code :
UPDATE FACTORYORDER
SET DUEDATE ="2001-30-07"
WHERE olddate ="2004-06-01";

error is : 2004-06-01 is invalllid identifier
write
Expand|Select|Wrap|Line Numbers
  1. update factoryorder set duedate='30-jul-01' where olddate='06-jan-04'
  2.  
this will solve your problem
Jun 26 '07 #6
Hi
how can i update the DATE field in a table
my code is

UPDATE FACTORYORDER
SET DUEDATE =7/30/2001
WHERE olddate =1/6/2004

showing error
suggest me where i need to change

use single quotes arround date becoz default is char data type

UPDATE FACTORYORDER
SET DUEDATE ='7/30/2001'
WHERE olddate ='1/6/2004'
Jun 26 '07 #7
Hi
how can i update the DATE field in a table
my code is

UPDATE FACTORYORDER
SET DUEDATE =7/30/2001
WHERE olddate =1/6/2004

showing error
suggest me where i need to change

HI,
DO THE FOLLOWING:
1.USE THIS QUERY : SELECT DUEDATE,OLDDATE FROM FACTORYORDER;
2.CHECK THE DATATYPE OF THIS TWO FIELDS AND THEN CHECK THE DATE FORMAT FOR THESE FIELDS.
3.NOW USE THIS QUERY FOR UPDATE:
UPDATE FACTORYORDER SET DUEDATE='30-JUL-2001' WHERE OLDDATE='06-JAN-2004';

NOTICE : ABOVE QUERY WILL UPDATE ALL THE RECORDS HAVING OLDDATE AS '06-JAN-2004'. BE SURE BEFORE COMMIT.
Jun 26 '07 #8
Thanks to all particularly Mr Debasisdas,i got my answer
Jun 26 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: siaj | last post by:
Hello All, If some one has faced a similar issue.. My datagrid Update command is not getting fired in fact it seems that the no event fires on...
1
by: Nathan | last post by:
Hi, I want to change a field in a database directly using an update command, not by changing a dataset first and then updating. I'm trying to...
1
by: Neo | last post by:
I konw that one can make use of the default UpdateCommand in the DataAdapter to save changes back into the underlying data source. But i was...
6
by: Dabbler | last post by:
I have a GridView with a couple of TemplateFields. When I click the update link the Gridview returns to display mode with no errors but the data...
2
by: TJ | last post by:
Hi All, I am having some trouble. I have created a database via the new database option inside VWD2005. Then and table or two. I have been...
0
by: =?Utf-8?B?V2ViQnVpbGRlcjQ1MQ==?= | last post by:
i get this message when i attempt an update in a gridview where i create the update manuelly. "Updating is not supported by data source...
1
by: Selvakumar | last post by:
hai friends, I am new to .net programming. I did the inserting data into MS-access database but i couldn't able to perform the update command. I...
1
by: jr1024 | last post by:
I am trying to update a Date field in mdb file, but I get "Update syntax error" at run-time This is my code: private void...
0
by: JDS | last post by:
I have a table with the primary key as a uniqueidentifier / GUID and the rowguid property set (it is used for replication). When creating a data...
3
by: kpeeroo | last post by:
Private Function AddCompanyOvertime() As Integer Dim companyID As Integer = GetCompanyID() Console.WriteLine(companyID) ...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.