Forum Replies Created

Viewing 6 posts - 1 through 6 (of 6 total)

  • RE: Converting varchar to datetime

    David Burrows (3/19/2015)


    CONVERT(datetime,[date],CASE WHEN [date] LIKE '%M' THEN 101 ELSE 103 END)

    You are legend, THANK YOU! Works :-D:-D:-D:-D

  • RE: Converting varchar to datetime

    Michael L John (3/19/2015)


    There is likely some data in this field that cannot be converted to a date.

    See what this returns

    SELECT Field

    FROM Table

    WHERE ISDATE(Field) <> 1

    Hi,

    With above it returns...

  • RE: Converting varchar to datetime

    That is how the data starts, then it changes from the day month year to month day year in the beggining which is causing the issue...as below

    3/16/2015 11:08:09 AM

    3/16/2015 12:54:01...

  • RE: Converting varchar to datetime

    21/01/2014 10:27:55

    21/01/2014 16:20:59

    21/01/2014 12:45:03

    18/01/2014 08:35:13

    22/01/2014 10:45:57

    22/01/2014 10:57:46

    22/01/2014 10:20:50

    22/01/2014 17:40:24

    22/01/2014 09:49:43

    21/01/2014 10:49:36

    17/01/2014 15:00:43

    23/01/2014 11:42:55

    23/01/2014 11:10:27

    23/01/2014 09:23:22

    23/01/2014 14:11:45

    23/01/2014 11:53:05

    23/01/2014 13:15:47

    24/01/2014 10:23:58

    25/01/2014 11:15:06

    16/01/2014 10:00:25

    24/01/2014 17:49:23

    27/01/2014 10:58:12

    27/01/2014 09:34:12

    27/01/2014 08:10:15

    26/01/2014 10:02:17

    27/01/2014 12:56:28

    24/01/2014 13:01:33

    27/01/2014 12:38:22

    24/01/2014 14:04:38

    27/01/2014...

  • RE: Converting varchar to datetime

    Hi,

    Have amended and still getting the same error 🙁

  • RE: Converting varchar to datetime

    I'm running the query against a replicated 3rd party database not setup by myself, which is proving to be very painful :ermm:

    I may be doing something wrong (I'm helping...

Viewing 6 posts - 1 through 6 (of 6 total)