About 11,200 results
Open links in new tab
  1. sql server - Converting a varchar date into a date (dd/mm/yy ...

    Sep 25, 2009 · 3 I have a CSV file that has dates written like this: 250909,240909 and they get stored in a SQL Server database as varchars. How do I get it to convert them into dates so …

  2. sql server - how to convert this varchar to datetime format?

    Msg 241, Level 16, State 1, Line 1 Conversion failed when converting date and/or time from character string. Can you please help, how to convert this varchar data to datetime format?

  3. sql server - Convert SQL Date MMDDYY varchar to Date?

    Feb 27, 2019 · 1 There is no method to directly convert this value because SQL implicitly assumes the first two characters are the year when directly converting to DATE and there is …

  4. sql server - Convert varchar into datetime and use date diff on the ...

    Nov 9, 2023 · 0 I have a field ABCD stored as varchar (16) and the data stored as 20170509074744CD. I am not versed with SQL Language. I will greatly appreciate any help …

  5. sql server - Inserting date from string: CAST vs CONVERT

    Dec 21, 2012 · CONVERT is specific to SQL Server, and allows for a greater breadth of flexibility when converting between date and time values, fractional numbers, and monetary signifiers.

  6. sql server - Convert a date to yyyymmdd format - Database ...

    May 17, 2013 · Which SQL command is recommended to convert a date to yyyymmdd format? convert (varchar (8), getdate (), 112); or convert (varchar, getdate (), 112) I notice that if I use …

  7. sql server - Convert date yyyy-mm-dd to integer YYYYMM

    Jul 14, 2015 · The problem is SQL Server has decided for you that that’s a varchar(1) long before you assign anything, and some style number won’t change its mind.

  8. sql server - Convert varchar column to datetime - Database ...

    Likely you have some data that doesn't fit the datetime column somewhere in the file. Insert to a staging table with a varchar or navachar field for the column and look at the data. You may …

  9. Switch VARCHAR to DATE in MySQL - Database Administrators …

    Dec 24, 2016 · I inherited a database that has a VARCHAR column that really should be a DATE. There's no checking on the form (I need to fix that) so dates constantly get entered as 2016-12 …

  10. sql server - How to convert getdate () stored as varchar to date ...

    Jan 23, 2023 · You can't convert it to a date, you never saved the date in the first place. The data simply isn't there. You can calculate a new date as the answers show.