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 3400370
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T04:53:05+00:00 2026-05-18T04:53:05+00:00

How can i convert a datetime of type dd-mm-yyyy to dd/mm/yyyy in sql? I

  • 0

How can i convert a datetime of type dd-mm-yyyy to dd/mm/yyyy in sql?
I dont want to convert to varchar but to datetime.
Can anyone give me an idea please?

  • 1 1 Answer
  • 1 View
  • 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-18T04:53:05+00:00Added an answer on May 18, 2026 at 4:53 am

    A DateTime is a DateTime is a DateTime – it doesn’t have ” a format” – it’s just a DateTime.

    The format or display options only come into play when you want to display the DateTime as a string.

    of type dd-mm-yyyy to dd/mm/yyyy

    To me, this sounds as if:

    • you have string representing a date, in the format dd-mm-yyyy
    • you want to convert that to a DateTime and then again display a string representing that DateTime in the dd/mm/yyyy format

    Right??

    Check out the MSDN SQL Server Books Online for CAST and CONVERT – it lists all possible, valid, supported string formats representing a date and time.

    Format dd-mm-yyyy is style no. 105, so this will convert your first string:

    SET @YourDateTime = CONVERT(DATETIME, '23-11-2010', 105)
    

    Now you have your DATETIME value (Nov 23, 2010) in @YourDateTime – just a DateTime, no formatting applied.

    If you want to display that date value in format dd/mm/yyyy, which is style no. 103, use this snippet of T-SQL to achieve this:

    SELECT CONVERT(VARCHAR(50), @YourDateTime, 103)
    

    This will display 23/11/2010.

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

Sidebar

Related Questions

I want to convert 8 digit value to a DateTime object. How can I
Does anyone know how I can take a MySQL datetime data type value, such
I try to convert string type dd.MM.yyyy HH:mm:ss.mmm to the datetime using the way
In SQL Server(T-SQL) you can convert a DateTime variable to a a decimal values
How can I convert DateTime Thu Nov 30 19:00:00 EST 2006 to 11/30/2006
How can I convert a string 08:00 to a DateTime datatype? Im trying to
Need to convert a string to normal datetime format so it can be correctly
Does mysql understand correctly 'YYYY-MM-DDThh:mm:ss' format for dateTime type? I have a few date
hey guys, i want to convert datetime from string, i have string which contains
I'm getting the following error when trying to convert a varchar to datetime in

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.