DateTime Question

  • I have a 2006 table with a column called DateTime.  At midnight, the date is the next day and each row's time are blank. (e.g. 1/1/2007         ).  I would like for each data row at midhight to be previous day's date and the following time (e.g. 12/31/2006 11:59:00)

    How do I perform an update query to correct all DateTime entries for the 2006 data table?

     

    In otherwords, how do I subtract a day off the date and set time to 11:59:00 for all entries at midnight?

     

    Thanks

    sql2day

     

     

  • DATEADD(n, -1, [DateTime])

    _____________
    Code for TallyGenerator

  • Would I query for all DateTimes that are blank and then update with function?

  • There are no datetimes with blank time. It's just the way EM presents datetimes with zero time parts.

    I cannot recommend to update or not to update anything because I don't know the business logic of your application.

    _____________
    Code for TallyGenerator

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply