Use a default value for a time section of the datetime field

  • I have a column "End Date" which is populated from a flat file that has date in dd/mm/yyyy format. The actual value that gets stored is dd/mm/yyyy 00:00:000 I want to replace the time part of the "End Date" with 23:59:999 so that it would really make sense as being an end date. Any help is appreciated

    Thank you.

  • First, datetime isn't quite that accurate. You might need to make the milliseconds 997 to get what you're looking for.

    Second, depending on how the data gets into the field, you could use DateAdd to add the hours, minutes, second, and milliseconds to it.

    Third, I wouldn't personally bother. The column title tells you what the data is. No need to mess with it beyond that.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

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

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