-- To get Time in the format - 9:45AM
select substring(convert(varchar(20),getdate(),100),13,7)
--To Get Date in the format -- 29-Dec-2010
replace(convert(varchar(12),getdate(),106),' ','-')
--To get Date & Time in the format - 29-Dec-2010(1:45PM)
select replace(convert(varchar(12),getdate(),106),' ','-') +'('+ltrim(substring(convert(varchar(20),getdate(),100),13,7))+')'
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment