• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 281
  • Last Modified:

SQL need help with date

Hello all,

I am trying to convert how I see a date from a select statement.

Right now I am getting date from my table like this. select LogDate from TestLog with (nolock)

And the output is 2011-08-16 09:45:33.260

Is there a way to do the select so I see the date as mmyyyy ?
1 Solution
SharathData EngineerCommented:
Try this.
select RIGHT(REPLACE(CONVERT(VARCHAR(10), LogDate, 103), '/', ''),6) from TestLog with (nolock)

Open in new window

try this

select right(replace(convert(varchar,LogDate,103),'/',''),6) from TestLog
Jesus RodriguezIT ManagerCommented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now