I am trying to write a simple query that retrieves the data field from a table (stored in the smalldatetime format) and converts the date to mmm yy format. The closest I can get is retrieving the date in the dd mmm yy format using the query below.
select convert(varchar(10),DATA_DATE,06) As DATA_DATE
If there an easy way to parse out the information I want? I also attempted to use the SUBSTR functions, but they always returned error messages.So you want to exclude the dd out of the datetime ?|||Try the following:
select right(convert(varchar(20),getdate(),06), len(convert(varchar(20),getdate(),06)) -3)|||That is exactly what I have been attempting to do. Thank you for your help.
Wednesday, March 7, 2012
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment