Dates and Times

Results 1 to 2 of 2

Thread: Dates and Times

  1. #1
    Join Date
    Dec 1969

    Default Dates and Times

    I am creating a asp forum and when a user replies to a message I have a SQL statement entering the current date and time that works fine followed by a SQL statement that updates the LastPostDate with the current date except that for some unknown reason the date comes up as 30/12/1899 and it also inserts a time in the LastPostTime even though i&#039ve not asked it to.<BR>I have done a repsonse.write statement and the SQL is correct.<BR>Any Ideas?

  2. #2
    Join Date
    Dec 1969

    Default RE: Dates and Times

    TIME alone is a lie. In VBS, for example, if you assign *just* a time to a variable, the date is automatically set to 1/1/1900.<BR><BR>That&#039s because a numeric value of zero is equivalent to 1/1/1900 at 0:00:00 time.<BR><BR>Negative numbers become dates prior to 1/1/1900. 30/12/1899 would be a -2.0 (or -2.nnnn if the time is given).<BR><BR>NOW...what is causing you to see that value? I dunno, but I&#039m sure it is a type mismatch somewhere in there.<BR><BR>Why in the world do you have separate LastPostDate and LastPostTime fields??? One field will hold the same information and save 8 bytes per record (plus overhead).<BR><BR>Anyway...If you want more diagnosis, you&#039ll have to show code. Pardon me if I don&#039t necessarily believe that the SQL is correct: It depends mightily on the datatypes of the fields in the table(s), and just dumping out the SQL won&#039t show us them, will it?<BR><BR><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