Problem in date data type. [message #209405] |
Thu, 14 December 2006 11:45 |
|
hi all,
i m using form 6i.
here i have a field 'years' .i changed its format mask property >> YYYY.
so at runtime i entered only year(2006) instead of complete date(as 14-dec-2006).
but problem is that at back end (oracle 9i data base) i got the values stored in table (column 'years') as '01-dec-0006 '
Quote: | i want to get values in same format as i used in front -end
| (2006).
next problem is same as above but here i change the format mask of my field as >> hh:mi am.(02:30 pm)
but at back-end (in table ), i got values as 01-dec-0006.
i want to get same format of time in table(in database).
can some one tell me the proper way to do so.
if i use some kind of query then can some one tell me which trigger of text field is most suitable for that query.
regards.
|
|
|
Re: Problem in date data type. [message #209411 is a reply to message #209405] |
Thu, 14 December 2006 12:49 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
The main problem (as far as I can tell) is that you are still using shortcuts.
It means that you constantly ignore suggestions to READ THE DOCUMENTATION. It is all in there, but it takes time to read it and understand what it says.
If you did that, you'd know that DATE datatype contains date and time component. Format mask you used ('yyyy') is just as if you selected TO_CHAR(sysdate, 'yyyy') - you'd get 2006, but it doesn't mean that 'sysdate' IS 2006 - it, as of writing these words, equals ~14.12.2006. 19:43 CET.
The same goes to your DATE column: it stores the whole date format: date + time. It is impossible to store only a 'year' or 'hours and minutes' into the DATE column. One should use DATE column to STORE data, but SELECT only what is interesting at the moment using the PROPER format.
In first case, you'd SELECT TO_CHAR(date_column, 'yyyy'); in another, you'd SELECT TO_CHAR(date_column, 'hh24:mi').
For your own good, do take a book and read it. Forum is useful, but it has its limits.
|
|
|
|
|
Re: Problem in date data type. [message #209782 is a reply to message #209411] |
Sun, 17 December 2006 20:31 |
|
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS Australia
|
Senior Member Account Moderator |
|
|
I'm really glad that I was busy on Friday and that Littlefoot answered this question. I probably wouldn't have been so nice.
David
|
|
|