Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: update a date field with fixed date but random hours/minutes

Re: update a date field with fixed date but random hours/minutes

From: Harry331 <harryooopotter_at_hotmail.com>
Date: 3 Mar 2006 11:09:57 -0800
Message-ID: <1141412997.576909.165100@i40g2000cwc.googlegroups.com>

Michel Cadot wrote:

> "Harry331" <harryooopotter_at_hotmail.com> a écrit dans le message de news: 1141410442.740870.319880_at_t39g2000cwt.googlegroups.com...
> | But I'm not sure how to come up with the final SQL to update Exam_Date
> | so that each record will have a different (and random) hh24:mi value.
> |
> | Any help appreciated.
> |

> Post what you've done and what seems wrong to you
> and we help you to complete.

The following SQL changed the exam_date to yesterday's date, but the hours/minutes
are all the same value (equal to that when I ran the SQL). What I want is to randonize the hours/minutes values.

update study s
  set s.my_exam_date_time = sysdate -1
where
  s.my_study_id in
(
select
  s.my_study_id as Study_ID
from
  study s
where
  to_char(s.my_exam_date_time, 'YYYY-MM-DD') >= '2006-01-01'   and to_char(s.my_exam_date_time, 'YYYY-MM-DD') <= '2006-02-28' )
; Received on Fri Mar 03 2006 - 13:09:57 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US