Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help displaying date/time value in VB program

Status
Not open for further replies.

CraigBest

Programmer
Aug 1, 2001
545
US
Hi folks

Don't know if anyone can help me, but I'm having trouble trying to display a full date/time value coming from an Oracle DB in a Visual Basic .NET 2005 application.

No matter what display mask I try to apply to the data (even no mask at all) all that ever displays is the date part, like this: "6/14/2007". I know that the time data is also there in the field, and what I actually want to display is the time part of the field.

Is there something I can do in the select statement I'm using to pre-format the data so I'll get the time value I'm looking for?

Thanks if you can help.






CraigHartz
 
Hi,

You can use the TO_CHAR function to display only the time part:
Code:
SELECT TO_CHAR(your_date_filed,'HH24:MI:SS') 
FROM yourtable

Stefan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top