SQL2K datatime datatype ???

Results 1 to 2 of 2

Thread: SQL2K datatime datatype ???

  1. #1
    Join Date
    Dec 1969

    Default SQL2K datatime datatype ???

    All,<BR><BR>Can anyone help me here. I have built a webpage that references a time held in a database in order to decide what to display.<BR><BR>All Fine.<BR><BR>The problem is that I need to allow certain admin people to be able to change this time. When I run an update function via the web, it automatically put 01/01/1900 at the start of the time, thus completely ruining the function to test what the time is, as it is always less !! I can manually type the time in either in Enterprise manager or via access, but I can&#039;t seem to update it to ONLY show the time ??<BR><BR>Is this something that anyone has come across, as it is really annoying me !<BR>Any ideas how to fix this ???<BR><BR>Regards<BR>Paul

  2. #2
    Join Date
    Dec 1969

    Default ASPFAQs, category Dates and Times

    There is a link to the ASPFAQs at the top right corner of this very page.<BR><BR>Look in the category noted in the subject line of this message for your question.<BR><BR>The ASPFAQs are your friends. Visit your friends often.<BR><BR>************<BR><BR>There is no possible way to store *JUST* a time in most databases, including SQL Server.<BR><BR>To prove that, do something like this on one of those *supposed* time-only values that you typed in via Enterprise Manager:<BR><BR>&#060;%<BR>Set RS = yourConnection.Execute("SELECT supposedTimeField FROM yourtable")<BR>Do Until RS.EOF<BR> Response.Write FormatDateTime( RS("supposedTimeField"), vbLongDate ) & "&#060;br/&#062;"<BR> RS.MoveNext<BR>Loop<BR>%&#062;<BR><BR>But read this, too:<BR><BR>http://msdn.microsoft.com/library/en-us/tsqlref/ts_da-db_9xut.asp<BR><BR>*ALL* those time-only values that you type in from EM *ACTUALLY* already *DO* have a date of 1/1/1900!!! Just as the docs say.<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