Calculation in timing wth Varchar2 Datatype [message #516304] |
Sat, 16 July 2011 07:56 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](http://www.orafaq.com/forum/images/custom_avatars/165441.jpg) |
umangsaini
Messages: 1 Registered: July 2011 Location: Delhi
|
Junior Member |
|
|
Hi Sir,
I'm newbie in Oracle, atcually I'm facing a problem where I create a form and I want to feed time in "HH:MI" format, Firstly I choosed the "Date" datatype, but during the feeding of time i.e "00:30", means if I want to feed only mints, thn it doesn't accept, at the other hand if I feed "01:30" means mints wth hr thn it accepts.
To get rid of this problem I changed datatype "Date" to "Varchar2".
I create 3 columns on my form "TTL_WORKING_TIME" - "TTL_RUN_TIME" = "BRK_DWN_TIME". If I get any value in "BRK_DWN_TIME" column thn it has to be distribute in 3 or 4 reason of B/D, means if I get 00:30 mints brkdwn thn 00:15 mints for "reason1" and 00:15 mints for "reason2".
Now the problem is, how I make calculation where I use "Varchar2" datatype. please guide me.
Thanks in advance.
|
|
|
Re: Calculation in timing wth Varchar2 Datatype [message #516332 is a reply to message #516304] |
Sat, 16 July 2011 14:02 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
![](http://www.orafaq.com/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21818 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
VARCHAR2 is certainly the wrong datatype. It *should* be DATE (in the database) and you should try DATETIME as form item's datatype. Apply the correct format mask.
Oracle computes date difference between DATE datatype values just fine.
It appears that your keyboard is somewhat broken (mints, thn, wth, brkdwn, ...). Could you, please, write full words?
|
|
|