Home » Developer & Programmer » Forms » Displaying something in a text item.
icon4.gif  Displaying something in a text item. [message #149937] Mon, 05 December 2005 14:53 Go to next message
Placey
Messages: 5
Registered: December 2005
Location: UK
Junior Member
Hello everyone.. must say Im very glad that I have found this forum.

I was wondering if anyone could help.

I have set up a procedure so that I can display the datatype DATETIME in a text item.

I was curious as to what the syntax was to do this. I thought it may be something like

To_Char('block name'.'text item name', 'DATETIME')

Can anyone help?
Re: Displaying something in a text item. [message #149939 is a reply to message #149937] Mon, 05 December 2005 14:57 Go to previous messageGo to next message
smartin
Messages: 1803
Registered: March 2005
Location: Jacksonville, Florida
Senior Member
Do you mean just output a date column as a character string, in a specific format of your choosing?

Just use the to_char function, but check out the sql reference guide for the proper syntax and for details on the format you can give your output.
Re: Displaying something in a text item. [message #149941 is a reply to message #149939] Mon, 05 December 2005 15:03 Go to previous messageGo to next message
Placey
Messages: 5
Registered: December 2005
Location: UK
Junior Member
Yes.. I just want to be able to use the sysdate and display it in a text item before it is added to the database.

Not sure what you mean by the sql reference guide.. very new.

Thanks for your help though.
Re: Displaying something in a text item. [message #149942 is a reply to message #149937] Mon, 05 December 2005 15:04 Go to previous messageGo to next message
smartin
Messages: 1803
Registered: March 2005
Location: Jacksonville, Florida
Senior Member
Read the sticky message at the top of this forum.
Re: Displaying something in a text item. [message #149948 is a reply to message #149942] Mon, 05 December 2005 15:20 Go to previous messageGo to next message
Placey
Messages: 5
Registered: December 2005
Location: UK
Junior Member
ok I will.. I have been trying to get anything let alone a date and time to display in a text item and it just doesnt seem to be working.

Why on earth did I choose a Computing Degree!?
Re: Displaying something in a text item. [message #150102 is a reply to message #149948] Tue, 06 December 2005 05:52 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
This is Forms, you might want your topic there Wink, so I'll move it.

How on earth can you display a DATATYPE itself? You define a text item and you give it a data type, e.g. datetime. You probably want the system's date (SYSDATE). You can use the Forms variable: $$DATETIME$$ (not sure about the exact spelling). Set it in the "initial value" property. The format is set in the "Format" property.

Another option is:
:block.item := SYSDATE;
in a post-query trigger or where ever you want it.

MHE

[Updated on: Tue, 06 December 2005 05:54]

Report message to a moderator

Re: Displaying something in a text item. [message #150266 is a reply to message #149937] Tue, 06 December 2005 23:27 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Instead of worrying about displaying it as a character field just define the item as being of type date or datetime, give it a mask, and as suggested use $$DATE$$ or $$DATETIME$$ as the initial value.

David
Previous Topic: how can we generate source code in developer from .fmx(exe)
Next Topic: PLSQL libraries in Linux
Goto Forum:
  


Current Time: Fri Sep 20 03:47:04 CDT 2024