469,330 Members | 1,373 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,330 developers. It's quick & easy.

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 105116
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

Post your reply

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

Similar topics

4 posts views Thread by siaj | last post: by
1 post views Thread by Nathan | last post: by
6 posts views Thread by Dabbler | last post: by
reply views Thread by =?Utf-8?B?V2ViQnVpbGRlcjQ1MQ==?= | last post: by
1 post views Thread by Selvakumar | last post: by
1 post views Thread by jr1024 | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by Purva khokhar | last post: by
reply views Thread by haryvincent176 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.