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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:49:11+00:00 2026-05-28T06:49:11+00:00

I have a string field dob which has birthdates in various formats e.g. dob

  • 0

I have a string field dob which has birthdates in various formats e.g.

dob

July 1, 1945
1967-1-7
13 May 1956

8 May 1947
27 September 1953
1952-3-25

I have attempted to use MS SQL 2005 to create a standardized date field

select convert(datetime,dob,103)
from myTable

I get an arithmetic overflow which appears to be associated with the last value, presumably because it is trying to convert the 25 to a month when it is a day
I have tried
setting the language to british and various other styles without success

Any suggestions?

  • 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-28T06:49:12+00:00Added an answer on May 28, 2026 at 6:49 am

    Why would you attempt to store it in a given format? Can you not just store it as a datetime type? The biggest advantage to storing it in a locale independent is that you can offload the presentation logic to the UI where it belongs. Plus, you can avoid messy situations where you have a DOB of 3-4-5 (2003 April 5th, March 4th 2005, 3rd April 2005).

    Conversion to a datetime works just fine for me (US locale).

    ; with myTable (dob)as
    (
        select 'July 1, 1945'
        UNION ALL SELECT '1967-1-7'
        UNION ALL SELECT '13 May 1956'
        UNION ALL SELECT '8 may 1947'
        UNION ALL SELECT '27 september 1953'
        UNION ALL SELECT '1952-3-25'
    )
    SELECT
        cast(T.dob AS datetime) AS real_datetime
    ,   T.dob
    FROM
        myTable T
    

    Results

    real_datetime   dob
    1945-07-01 00:00:00.000 July 1, 1945
    1967-01-07 00:00:00.000 1967-1-7
    1956-05-13 00:00:00.000 13 May 1956
    1947-05-08 00:00:00.000 8 may 1947
    1953-09-27 00:00:00.000 27 september 1953
    1952-03-25 00:00:00.000 1952-3-25
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a class which has a String field called name . I have
In my asp.net-mvc website I have a field that usually has a string (from
Suppose I have a table that has three integer fields and one string field
We have a string field which can contain XML or plain text. The XML
I have a string field in which csv row is inserted '6 33','318011385','3183300153','Z','21.11.2011 13:33:22','51','51','2','0','032425','','','','','8
I have an ActiveRecord model that has a long string field. Actually, this string
I have annotated a String field with @NotEmpty tag. When I try to persist
I have to convert an incoming String field into a BigDecimal field that would
I have a requirement to disallow backslash characters in a given string field defined
I have an input field whose name is an MD5 string e.g.: <input type=hidden

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.