473,405 Members | 2,279 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,405 software developers and data experts.

how to update current date and current time in DB2 table

Hi Experts,

I am new to SQL, trying to update the table with processed date (current date) and time(currenttime).

I am picking up the data and updating two fields processedDate (8, YYYYMMDD) and processed time(6, HHMMSS).
Picking the data from DB2 table:
SELECT columns FROM schema.table WHERE ProcessedDate= 0 AND processedTime= 0 ORDER BY column (orderNumber)

Update the processedDate:
UPDATE schema.table SET ProcessedDate=
(SELECT YEAR (CURRENT DATE) * 10000 + MONTH(CURRENT DATE) * 100 + DAY (CURRENT DATE) FROM
schema.table WHERE ProcessedDate= 0 FETCH FIRST 1 ROWS ONLY) WHERE ProcessedDate= 0
I hope the above will work for processedDate (current date).
how do we do that for processedTime?

Thanks
Mar 16 '15 #1
0 2007

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

Similar topics

7
by: TenOCC | last post by:
I have an event that update my database, I would like to record the current date and time when the record was updated. Not quite sure of the command Conn.Execute ("UPDATE dM SET OpenDate =...
10
by: jerry.ranch | last post by:
I used =now() in a text box and that nicely displays date and time at the moment of opening How would I show updated data? I thought of an event procedure, but which one would I use since...
2
by: paeez | last post by:
how can i get the current date and time of the system And use it as the data part of a doubly link list.?
1
by: smowbray | last post by:
I am trying to populate a timestamp on a form when a certain event happens. I am just starting to learn scripting and hope someone can help. On my form there is a button that calls another process....
2
by: ben thaire | last post by:
i have several checkboxes, some in the main form and others in a subform. i would like to have the current date and time recorded when they are checked. so far i've only been able to get a date of...
4
by: ssknov | last post by:
hi i need to access the server machine's current date and time? Pls any body explain me in detail how to do this . since i am a beginner, i find it difficult to perform this. Help me thanks in...
5
Paul NIcolai Sunga
by: Paul NIcolai Sunga | last post by:
hi to all, could i ask what method will i use to display the current date and time in a browser?..thankz regards, Paul Nicolai Sunga
3
by: perhapscwk | last post by:
I using a insert query to insert some data into mysql. I use now() as the current date and time but it always have 3.X hours different from actual date. what i should use instead? thanks.
4
by: Sreeram Charan | last post by:
I am trying to obtain current date and time with milliseconds in an Embedded application using C programming language in Kiel compiler. can any one suggest how can I do this.
1
by: Gajju | last post by:
I want to add current date and time in one field in sql. Can anyone please help on this?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.