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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I need help writing a SELECT query. 2

Status
Not open for further replies.

rarubio1

Programmer
Jan 25, 2002
64
US
My SELECT query needs to format a field whose datetype is smalldatetime. The values returned by my query look like this: 1/1/1900 9:40:00 AM.
I need the values to look like this: 9:40 AM

How can I write my query so that it formats the field for me?

Thanks,
RR :)
 
I guess you could create a UDF that mimics
select convert(char(10),getdate(),101) + ' '+ convert(char(5),getdate(),114)

I hope this helps.

- forevertechie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top