convert function

Results 1 to 2 of 2

Thread: convert function

  1. #1
    Join Date
    Dec 1969

    Default convert function

    &nbsp;<BR>I need to convert a numeric col of format yyyymmdd to datetime in sql server 2000.<BR><BR>convert(DateTime,dtcol) gives me overflow error.<BR><BR>any suggestions?<BR><BR>thanks,<BR>nagarajan<BR>

  2. #2
    Join Date
    Dec 1969

    Default Never done that, but...

    ...a couple of things to try:<BR><BR>CONVERT( DateTime, dtcol, 112 )<BR> 112 is the ISO format, yyyymmdd<BR><BR>If that doesn&#039;t work, you might need to convert to varchar first and then to DateTime:<BR><BR>CONVERT( DateTime, CONVERT( VarChar, dtcol ), 112 )<BR><BR>Do either of those work?<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts