Tuesday, March 20, 2012

convert year from mm/dd/yyyy to mm/dd/yy

I am working with a chart. I want to display the year on the X axis as mm/dd/yy. I have tried entering yy, etc into the format code field and have had no luck.

Any comments are appreciated.

Reporting Services uses similar formatting commands to Excel. You should be able to use MM/dd/yy.

If that doesn't work, another way would be to create a function that would return the values in a string format and parse the string. Something like:

public function getDate(dt as string) as string

string dt = left(dt,6) & right(dt,2)

return dt

end function

cheers,

Andrew

|||

Thanks! I was able to get this to work

CONVERT(varchar(12), field_name, 10) AS Date

No comments:

Post a Comment