Proplem in storing data and time in the field [message #291106] |
Thu, 03 January 2008 00:51 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
LAZYGIRL
Messages: 34 Registered: May 2006
|
Member |
|
|
i have problem in saving date and time in date filed
this is first time i face it in forms
i know oracle by default save date and time in the date field
i define start_date as timestamp field and in the property pallete oe the form i define the data type as datetime and the format mask dd-mm-yyyy when i run the form the user enter the date but when it save in the database it always give me that the date and time but the time is incorrect it gives me always 12:00:00 AM
never change
i dont know how to solve this problem i want the user to put the date and in the database it well save both data and time
any one have a way to solve my problem
[Updated on: Thu, 03 January 2008 00:52] Report message to a moderator
|
|
|
|
Re: Proplem in storing data and time in the field [message #291151 is a reply to message #291121] |
Thu, 03 January 2008 03:19 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
In my opinion, question itself doesn't make sense.
For example, if user enters (in dd.mm.yyyy format) value '30.03.2007', it - obviously - doesn't contain time information (actually, it does, but it defaults to 0:00:00). Now, what would be the correct time in your opinion, Lazygirl? Would it be 2:13:28 or 14:33:19 or something else? Perhaps time taken from the SYSDATE? If so, why would you want to do that?
In other words: if you chose to use item format as 'dd-mm-yyyy', you can not expect to have time in there. If you want to have time, change format to 'dd-mm-yyyy hh24:mi:ss' (for example), but it will force user to enter values in this format.
What to do? Well, it depends on business requirement. Talk to someone in business team and see what he/she says about it.
|
|
|
|
Re: Proplem in storing data and time in the field [message #291261 is a reply to message #291179] |
Thu, 03 January 2008 09:51 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
![](/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Quoting and answering at the same time:
Quote: | - so the user will enter the date -> true
- without able to see the time -> true
- and in the databse it well save the date and time -> true, only that time will be 0:00:00 again
|
The only way to store time is
a) to leave the default value ($$datetime$$)
b) let user enter date AND time
In other words, you did not solve the problem.
|
|
|