Data Warehousing Community Forum
February 08, 2012, 10:36:06 pm

Pages: [1]   Go Down
  Print  
Author Topic: Query based on date-timestamps  (Read 802 times)
Sipra
Founder
*****

Reputation: +59/-0
Offline Offline

Posts: 323


Am the King...


View Profile WWW
« on: March 21, 2008, 04:32:56 pm »

SR_ID   UPDATED_TIME   
1-XYZ   20-SEP-07 10.10.10.000000 AM   
1-XYZ   20-SEP-07 10.20.10.000000 AM      
1-XYZ   20-SEP-07 10.40.10.000000 AM   
1-XYZ   20-SEP-07 11.10.10.000000 AM   
1-XYZ   20-SEP-07 11.20.30.000000 AM   
1-XYZ   20-SEP-07 12.12.10.000000 PM      
1-XYY   20-SEP-07 12.40.10.000000 PM   

I want to import this flat file in oracle table.But i don't know what datatype i should take for Updated_time in oracle table
PLease help me out

Hope the following query resolves -

select to_char(sysdate, 'DD-MON-YYYY HH24.MI.SS.SSSSS') as Timestamp from dual

TIMESTAMP                 
21-MAR-2008 07.03.15.25395

Logged

Arvind
DW Apprentice
**

Reputation: +10/-0
Offline Offline

Posts: 78


View Profile
« Reply #1 on: May 24, 2008, 10:51:49 pm »

Having a requirement,

I have this statement (to_char(load_timestamp,'DD-MM-YYYY HH24:MI') which gives the following output -

24-05-2008 23:01

But in the requirement the data needs to be loaded in the following format

20080524 2301

Any answer much appreciated..
Logged

regards,
Arvind
samishta
DW Fresher
*

Reputation: +2/-0
Offline Offline

Posts: 17



View Profile
« Reply #2 on: May 29, 2008, 01:04:22 am »

Try using some format like 'DDMMYYYY:HHMI'

If this doesnt work try getting the date formated and time formatted part out as characters and concatenate them as per your will to make another char/varchar field value.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to: