CFF KB - Carrz-Fox-Fire Promotions Knowledge Base

CFF KB is all about 1 thing: The Sharing of Knowledge and the Power we gain from it.
  • Breadrumbs:
  • Update Records in SQL Server Table of type DateTime

  • CFF Knowledge Base - Share With Facebook CFF Knowledge Base - Share on Twitter CFF Knowledge Base - Share on Reddit CFF Knowledge Base - Share on Digg It CFF Knowledge Base - Share on Stumble Upon It CFF Knowledge Base - Share on Delicious
    Share With Friends (Updated 6-8-2010)
  • Article ID:
    18
  • Date Created
    Thursday, September 30, 2010
  • Last Updated
    Wednesday, June 20, 2012
  • This Article Has been Viewed
    1815 times
  • Short Desc
    If you are wanting to update a datetime column in your sql server database, this is how it is done.
  • Details
    Updating current records in a SQL Server database from a Column of Type: DateTime using the CONVERT function.
  • Recreate Issue
    Updating datetime field will sometimes not update or will give an error. Using the CONVERT function will correct this behavior.
  • Resolve Issue
    To update your DateTime Column within SQL Server Database, run the following action.

    <%
    UPDATE MyTabe SET DateUpdated = CONVERT(DATETIME, '1900-01-01 00:00:00', 102)
    %>