Home » Developer & Programmer » Forms » date display through global varibales
date display through global varibales [message #344724] Mon, 01 September 2008 02:07 Go to next message
varu123
Messages: 754
Registered: October 2007
Senior Member
I have set the datatype of date textitem to datetime.
This particular textitem is aasigned date through global variables.
:block1.dt:=:global.vd;


But when I do some testing data entry,the date column in database of the corresponding table is not populated with the format:
hh:mi:ss
SQL>select dt from tbl;
01-SEP-08 00:00:00

If I use sysdate insted of global variables,It does.
:block1.dt:=sysdate


SQL>select dt from tbl;
 01-SEP-08 11:34:21


Are there any special restrictions to global variables?

Re: date display through global varibales [message #344742 is a reply to message #344724] Mon, 01 September 2008 02:54 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
SYSDATE contains both date and time. We have no idea what "global.vd" looks like.

Also, note that global variables are of a CHARACTER datatype so you'd perhaps want to explicitly convert this character into a DATE datatype (using the TO_DATE function).
Re: date display through global varibales [message #344798 is a reply to message #344724] Mon, 01 September 2008 05:07 Go to previous messageGo to next message
varu123
Messages: 754
Registered: October 2007
Senior Member
I have also tried by using to_date function.
to_date(:global.vd)


but no success.
Re: date display through global varibales [message #344801 is a reply to message #344798] Mon, 01 September 2008 05:10 Go to previous messageGo to next message
mudabbir
Messages: 235
Registered: April 2006
Location: Kuwait
Senior Member

try

to_date(:global.vd,'DD-MM-YYYY HH:MI:SS AM');
Re: date display through global varibales [message #344808 is a reply to message #344801] Mon, 01 September 2008 05:33 Go to previous messageGo to next message
saadatahmad
Messages: 452
Registered: March 2005
Location: Germany/Paderborn
Senior Member

@varu123

what does this link tell you?

http://www.orafaq.com/forum/t/124039/67693/

regerds,
Saadat Ahmad

[Updated on: Mon, 01 September 2008 05:34]

Report message to a moderator

Re: date display through global varibales [message #344829 is a reply to message #344724] Mon, 01 September 2008 06:07 Go to previous messageGo to next message
varu123
Messages: 754
Registered: October 2007
Senior Member
@mudabbir
tried
to_date(:global.vd,'DD-MM-YYYY HH:MI:SS AM');


But the result is displayed as
01-SEP-08 12:00:00


@saadat
this link tells me that if the textitems are populated by sysdate,only changing to dateitem would work.

But in my case,it is not working with global variables.

Re: date display through global varibales [message #344862 is a reply to message #344829] Mon, 01 September 2008 08:01 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
We still have no idea what "global.vd" looks like.
Re: date display through global varibales [message #344902 is a reply to message #344724] Mon, 01 September 2008 13:14 Go to previous messageGo to next message
varu123
Messages: 754
Registered: October 2007
Senior Member
:global.vd looks like DD-MON-YY
Re: date display through global varibales [message #344907 is a reply to message #344902] Mon, 01 September 2008 14:37 Go to previous message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
So, in your opinion, which part of "dd-mon-yy" contains hours, minutes and seconds?
Previous Topic: hh:mm:ss with date
Next Topic: FRM-40352 and Last record of query
Goto Forum:
  


Current Time: Mon Feb 03 12:43:22 CST 2025