Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6709239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:51:26+00:00 2026-05-26T07:51:26+00:00

I have a column of data in SQL that is currently in the datetime

  • 0

I have a column of data in SQL that is currently in the datetime format. It can be changed if needed. I need to show just the time of day, to the 10th of a second, with either AM or PM attached also. I do not want the date to be shown in this instance.

So instead of ‘1900-01-01 11:45:59.800′ as an example, i need ’11:45:59.8 AM’.
Also, this is not a current “getdate” time. It is from a field of data i have called ‘Time’
I see all sorts of convert formats on the web, but none will pull this up for me.

Thank you!!!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T07:51:27+00:00Added an answer on May 26, 2026 at 7:51 am

    As in my comment, I’d advise you to not do this.

    SQL Server is a place for data, and converting the data for display purposes is often a blurring of the lines that can come back to haunt you. (One example; what if you need that time as a Time somewhere else in the future. Are you going to convert it back from a string again?)

    If it is Necessary, then you have to do some of the formatting yourself.

    SELECT
      RIGHT(CONVERT(VARCHAR(26), GETDATE(), 109), 14)
    

    Or, more messy…

    SELECT
      DATEPART(HOUR, GETDATE()) + ':' +
      DATEPART(MINUTE, GETDATE()) + ':' +
      DATEPART(SECOND, GETDATE()) + '.' +
      DATEPART(MILLISECOND, GETDATE()) +
      CASE WHEN DATEPART(HOUR, GETDATE()) < 12 THEN 'AM' ELSE 'PM' END
    

    Did I say? You’re better doing it on the client side 😉

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to format data in a sql column that is currently entered like
I currently have a table(/grid) of data that I can page, filter and sort.
I have a column of data that contains a percentage range as a string
I have a User_Id column with data DOMAIN\USERID I need it to be DOMAIN\userid
I have a column that has the following data: PersonId=315618 LetterId=43 MailingGroupId=1 EntityId=551723 trackedObjectId=9538
I have a varchar column that has data like this top<somenumber> so the word
I have datatable with column name tag and 100 rows of data.I need to
So I have this SQL table that I need to update. Now we use
I have a project that can use either SQL Server or MS Access as
From my experience I have learn that using an surrogate INT data type column

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.