Home » Developer & Programmer » Forms » ....... Date Issue
....... Date Issue [message #155483] Mon, 16 January 2006 08:50 Go to next message
orcl_dba
Messages: 84
Registered: March 2005
Member
I have a Date Column in my table named Tdate.
My Block which select * from the Table, does not show the time Values in Forms 6i.When i want to use a query
e.g
Select Empno,ename from emp where to_date(Tdate,'dd/mon/yy') = '01/Jan/06'
The result is NO ROWS RETURNED.
Is it because of the time value, should i use the Like '1/Jan/06'%'
i have used this LIKE clause but still not result.

Does any body know how to use this tdatei n where clause in Forms 6i.
Secondly i would like to ask that how to restrict user to enter date in a specific Format through Forms 6i.
Suppose i want that whenever user enter date value in text box,
it should be like dd/mm/yy or dd-mon-yyyy

How to do that .. what would be the validation check.
Anybody with part of code, will be of great help.i have been trying hard for 2 days but getting nothing, quite frustrated now.

Thnx alot for the Help

Regards
Re: ....... Date Issue [message #155511 is a reply to message #155483] Mon, 16 January 2006 19:06 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
1) Use TRUNC to remove the hours and minutes.
2) Add a format to your date timestamp field definition (property sheet) to display it the way you want it. To have a different format for data entry versus data display then change the format in a pre-text-item trigger and put it back in a post-text-item trigger (use set_item_property(format_mask)).

David

[Updated on: Mon, 16 January 2006 22:44]

Report message to a moderator

Re: ....... Date Issue [message #155521 is a reply to message #155511] Mon, 16 January 2006 22:39 Go to previous messageGo to next message
ashishmate
Messages: 90
Registered: February 2005
Location: Mumbai
Member

Hi
I Think You want To Show Date And Time If Yes Use datetime Data Type For The Date Item.


ASHish...
Re: ....... Date Issue [message #155530 is a reply to message #155511] Tue, 17 January 2006 00:56 Go to previous messageGo to next message
orcl_dba
Messages: 84
Registered: March 2005
Member
David. thnx for reply but kindly elaborate.i dont get you exactly the way i should .Sorry to ask you again but if you kindly elaborate a bit or give a slight/short example , that would reallly be helpful.
thnx alot
Re: ....... Date Issue [message #155662 is a reply to message #155530] Tue, 17 January 2006 17:12 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
I really don't feel like doing ALL the work for you.

How about you show me that you know what TRUNC is! Try something like "select sysdate, trunc(sysdate) from dual" in TOAD or "select to_char(sysdate,'DD-MON-YYYY HH24:MI:SS'), to_char(trunc(sysdate),'DD-MON-YYYY HH24:MI:SS') from dual" in SQL*Plus. Now use the same structure in the where clause.

Create the field, add the format in the property sheet, run the form, look.

Now add the trigger, add the 'set' command, run the form, look. Add the second trigger, add the re'set' command, run the form, look.

Show us what YOU have done and we'll help you get the look and feel you want.

David
Previous Topic: Forms2000 and Oracle 9i
Next Topic: Deleting records
Goto Forum:
  


Current Time: Fri Sep 20 04:00:30 CDT 2024