Home » Developer & Programmer » Forms » conversion problem
icon11.gif  conversion problem [message #217452] Fri, 02 February 2007 05:32 Go to next message
lunate
Messages: 74
Registered: October 2006
Location: Pakistan
Member


hi all,

i have a problem.
i have a 'text-box' with name 'txt' in a control-block of a form.ok

and i have a table in back-end .

SQL> select ldr_no ,yr from leader_info;

LDR_NO YR
--------------- ---------
1066 01-DEC-06
1085 01-DEC-06
1063 01-DEC-06
327 01-DEC-06
007 01-DEC-07
1234 01-DEC-07

6 rows selected.

now problem is that , i want to insert only 2006 in the text-box named txt in front-end.
and want to extract the LDR_NO ,yr from table where date is same as the given number in text box ,just like

only these willbe selected .

LDR_NO YR
--------------- ---------
1066 01-DEC-06
1085 01-DEC-06
1063 01-DEC-06
327 01-DEC-06

if i insert 2007 then i want to get .

LDR_NO YR
--------------- ---------
007 01-DEC-07
1234 01-DEC-07


i use to_Date(txt,'rrrr') function in the select command but it is not generatin the desire result.

i think it is a simple problem but now i m too much tired. Razz Laughing Mad

so help me now how i do this possible.

regards.
Re: conversion problem [message #217609 is a reply to message #217452] Sat, 03 February 2007 00:36 Go to previous messageGo to next message
lunate
Messages: 74
Registered: October 2006
Location: Pakistan
Member

hello

please help me. Embarassed
Re: conversion problem [message #217650 is a reply to message #217609] Sun, 04 February 2007 00:37 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Do it the other way around: compare the year from the date-field in the table (extract (year from yr)) to the year entered.
Re: conversion problem [message #217726 is a reply to message #217650] Mon, 05 February 2007 01:55 Go to previous messageGo to next message
lunate
Messages: 74
Registered: October 2006
Location: Pakistan
Member

i have solved my problem
simply ;

select ldr_no,yr from ldr_info_dup where to_char(yr,'yyyy')=:txt;

Re: conversion problem [message #217958 is a reply to message #217726] Tue, 06 February 2007 04:19 Go to previous message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Yea, and you just voided the use of the index on 'yr'.

David
Previous Topic: HIDE_WINDOW('WIN') by text_item trigger
Next Topic: 100501 non oracle exception !
Goto Forum:
  


Current Time: Sat Dec 10 02:57:50 CST 2016

Total time taken to generate the page: 0.05641 seconds