473,326 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 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 106496
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 clicking the update link. Although the cancel and the...
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 use a command similar to this: ...
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 wondering how one could build a custom update command &...
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 from bound text fields or dropdown list isn't...
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 able to perform INSERT and SELECT operations on...
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 'dsStkStdData' unless UpdateCommand is specified. " ...
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 used only textbox and command button for inserting...
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 dataGrid_CellEndEdit(object sender, DataGridViewCellEventArgs e) {...
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 table in a dataset in VS2005 the table adapter...
3
by: kpeeroo | last post by:
Private Function AddCompanyOvertime() As Integer Dim companyID As Integer = GetCompanyID() Console.WriteLine(companyID) Dim paramCompanyID As New SqlParameter("@CompanyID",...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.