Results 1 to 3 of 3

Thread: timestamp???????????/

  1. #1
    Join Date
    Dec 1969

    Default timestamp???????????/

    Does anyone know the syntax in a insert statement for the data type timestamp. The user has a input box where they enter in a date on the web-side. The internal users need the time part, so it is stored as a timestamp. The web-side user doesn&#039;t have to enter in a time, but I get an ERROR ON MY INSERT STATEMENT because of this data type involvement of the time.<BR><BR>sql= "INSERT INTO Trade_Name(Trade_Name, Start_Date, End_Date ) "<BR><BR>sql=sql & "Values(" & "&#039;" & request ("Trade_Name") & "&#039;,&#039;"<BR>sql=sql & Request("Start_Date") & "&#039;,&#039;"<BR>sql=sql & Request("End_Date") & "&#039;)"<BR><BR>Thanks for any help. I&#039;m using sybase with the possibility to switch over to oracle.

  2. #2
    Join Date
    Dec 1969

    Default RE: timestamp???????????/

    It&#039;s not ASP. You have to enter into the database timestamp column GETDATE() as a default value . You don&#039;t need to do it in the insert statement.

  3. #3
    Join Date
    Dec 1969
    Los Angeles, CA

    Default timestamp datatype???

    Is timestamp the datatype??<BR><BR>and i assume start and end dates have valid dates in them...<BR><BR>Now i am not sure how it works in sybase but as far as MS SQL is conserned.....you cannot enter a date value into a timestamp data type...it is updates automatically when you insert or update the column...it hold BINARY data and you cannot insert anything into it.<BR><BR>But if YOU are jsut calling it a timestamp and it is actually a datetime then if the dates are valid it will work....just response.write your SQL.<BR><BR><BR>Again this is for MS SQL and NOT Sybase.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts