Home » Developer & Programmer » Forms » How to retrive date&time records in forms
icon5.gif  How to retrive date&time records in forms [message #167412] Wed, 12 April 2006 20:27 Go to next message
yash1000
Messages: 22
Registered: August 2005
Junior Member
Hi,

I have created table called EMP which has three column
empno,hiredate, sal

EMP
EMPNO number,
hiredate DATE,
sal number.

I have created three records
EMPNO HIREDATE SAL
1 13-Apr-2006 13:07:51 300
2 19-Mar-2006 13:10:12 400
3 12-Feb-2006 13:10:39 500.

1. I have created form called EMP_FRM to display the records
2. I want to display hiredate in DDMONRR foramt. I have set it's format mask properties to DDMONRR.

My problem when I run the form and query on hiredate and empno with value as 19MAR06 and 2 respectively.

I do not get any record display, but I get frm-40301. Query cause not records to be re-trived. Re-enter.


Could you please help me to work around with this issue.

Many Thanks,

Yash.


Re: How to retrive date&time records in forms [message #167418 is a reply to message #167412] Wed, 12 April 2006 23:22 Go to previous messageGo to next message
RAS_SANKAR
Messages: 42
Registered: March 2006
Location: India
Member
hi yash,

where did u enter records ? i mean u entered records from sql*plus or forms. if it is sql*plus u just give commit and do the same again.

-Ras.
Re: How to retrive date&time records in forms [message #167421 is a reply to message #167418] Wed, 12 April 2006 23:29 Go to previous messageGo to next message
yash1000
Messages: 22
Registered: August 2005
Junior Member
the problem is not in entering records but retriving records from form specially

when query hiredate column wuth value 19APR06 or any other value in DDMONRR format.

Re: How to retrive date&time records in forms [message #167428 is a reply to message #167421] Thu, 13 April 2006 00:01 Go to previous messageGo to next message
sanka_yanka
Messages: 184
Registered: October 2005
Location: Kolkata
Senior Member

Which version of oracle r u using.
It works fine in Oracle 10g Forms Service.
I m sending u the form.
Try to run it.

Regards,
Sanka
Re: How to retrive date&time records in forms [message #167429 is a reply to message #167428] Thu, 13 April 2006 00:07 Go to previous messageGo to next message
yash1000
Messages: 22
Registered: August 2005
Junior Member
i am using form6i
Re: How to retrive date&time records in forms [message #167430 is a reply to message #167429] Thu, 13 April 2006 00:10 Go to previous messageGo to next message
sanka_yanka
Messages: 184
Registered: October 2005
Location: Kolkata
Senior Member

Then I don't know, it will work or not.
but if u used higher version then it will work.
Re: How to retrive date&time records in forms [message #167438 is a reply to message #167430] Thu, 13 April 2006 00:48 Go to previous messageGo to next message
RAS_SANKAR
Messages: 42
Registered: March 2006
Location: India
Member
I tested what u said. it is working fine

see this form.
  • Attachment: RAS.fmb
    (Size: 44.00KB, Downloaded 1007 times)
Re: How to retrive date&time records in forms [message #167447 is a reply to message #167421] Thu, 13 April 2006 01:50 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Please detail, key-stroke by key-stroke what you do with your form, and what is happening.

David
Re: How to retrive date&time records in forms [message #167923 is a reply to message #167447] Mon, 17 April 2006 22:58 Go to previous messageGo to next message
yash1000
Messages: 22
Registered: August 2005
Junior Member
As I have explanied earlier I have created table with following data. As show below

EMPNO HIREDATE SAL
1 13-Apr-2006 13:07:51 300
2 19-Mar-2006 13:10:12 400
3 12-Feb-2006 13:10:39 500.

FORM CHANGES

1 . I have created EMP data block,using data block wizard and followed the normal sequene till the completion of Layout wizard.


2.Now I am running the form(form version [32 Bit] Version 6.0.8.14.1) and want to retrive employe hired on 13-Apr-2006 date. When I queried on hiredate column with value 13-Apr-2006 I get no record returned. But as you can see record exists in DATABASE for 13-APR-2006.

I hope I have answered you question. Let me know if you any doubt.

Cheers,

Yash


Re: How to retrive date&time records in forms [message #167932 is a reply to message #167923] Tue, 18 April 2006 00:32 Go to previous messageGo to next message
RAS_SANKAR
Messages: 42
Registered: March 2006
Location: India
Member
change the format mask of date field as

fmDD-Mon-YYYY
Re: How to retrive date&time records in forms [message #167965 is a reply to message #167923] Tue, 18 April 2006 02:34 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Yes, your record 'exists' in '13-APR-2006' but you are searching FOR '13-APR-2006' which means '13-APR-2006 00:00:00' not '13-APR-2006 13:07:51'.

We need to handle your HIREDATE in one of a couple of different ways.
(1) For example, either have two fields OVERLAYED so that you do data entry in one and retrieval in the other. The first is the database date time field and the second is a non-database date field. In the 'where' clause you have 'trunc(HIREDATE) = NVL(:blk.NDB_HIREDATE,trunc(HIREDATE))'. You will have to find and show the fields as you go.
(2) Your HIREDATE is NOT displayed on the canvas. In the Post-Query trigger you have ":blk.NDB_HIREDATE := :blk.HIREDATE;". The field NDB_HIREDATE IS displayed on the canvas. In the Pre-Insert and Pre-Update triggers, OR, repeat OR, in the When-Validate-Item you have ":blk.HIREDATE := :blk.NDB_HIREDATE;". Then in your 'where' clause you can have 'trunc(HIREDATE) = NVL(:blk.NDB_HIREDATE,trunc(HIREDATE))' or if you DO wish to search by date and time then you could use the default_where facility of the Set_Block_Property to add the required retrieval code. Search this forum for 'default_where' for examples.

David
Previous Topic: WHEN-VALIDATE-TRIGGER IS NOT FIRING
Next Topic: Change User Password on Runtime
Goto Forum:
  


Current Time: Fri Sep 20 08:26:21 CDT 2024