• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Oracle Date Type

 
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi guys..
Actually i m converting sql queries to oracle 1s...
So i need some help..
Here i am..
I have a query which gets me the difference between two dates in seconds...
select convert(float,datediff(ss,convert(varchar,Shift_Master.First_Punch_Time,108),convert(varchar,Attendance.First_Intime,108)),108) from emp_master,Attendance,shift_master

what will be the oracle version of these query..

can any1 help me..
regards,
Nischal
 
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
try:
SELECT ( date1 - date2 ) *24*60*60 FROM TABLE_1
 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there,
I 'll not be solving your problem but I have got two clues for you:
- looks like you got your dates stored in character columns You 'll need the TO_DATE function with a nice formatting string to make these values real dates (
- in Oracle SQL the difference between two date values is always a number of days, so you 'll have to multiple it by 24 * 3600 to get seconds.
Good luck,
Rudy.
 
reply
    Bookmark Topic Watch Topic
  • New Topic