How to create a datetime from parts in Oracle/PLSQL? -


I have a date (4/30/2012), one hour (4) and one minute (45). I have to convert that Oracle datetime value to compare in a PLSQL / Oracle Selection statement. Ideally, there will be such a ceremony (since C # I know it a bit better):

  var date = "4/30/2012"; Var hour = "4"; Var minutes = "45"; Date time myDateTime = convert datetime (date, hour, minute);   

I have three columns to create an event date and time. I have another table that contains items that do not match on the basis of their start and end dates. In Pseudo SQL, this is what I am trying to do:

  SELECT G.Name, (Select MAX (cost) from CrappyTable to C WHERE live streamman & lt; convert datetime (CD, C. Haur, C. Minute) and G & T> Convert Datime (C.Date, C. Haur, C.Mitt.) Live as good as G Price and lt; 100.00; Select   

or "name and maximum cost (from the reported cost during a deadline) where the cost is less than $ 100."

Is there an existing task that can do something like the above convertDateTime function?

Insert your date and time zones and pass them on TO_DATE (24 hour clock time) It seems your date / time:

  TO_DATE (date) '' || hour || ':' min, '  

The values ​​will change to Oracle DATE type.

Comments