Loading ...
Sorry, an error occurred while loading the content.

Re: [SQLQueriesNoCode] Trouble inserting a timestamp!

Expand Messages
  • Michael Brinkley
    Maybe use single quotes around the values??? What I do for adding a time stamp is to make the TimeStamp a date field and making the default getdate(). Works
    Message 1 of 5 , Sep 22, 2004
    • 0 Attachment
      Maybe use single quotes around the values???

      What I do for adding a time stamp is to make the TimeStamp a date field and
      making the default getdate().

      Works for me.

      --- jephmat@... wrote:

      > I have fashioned an SQL insert for a database that contains two
      > TIMESTAMP fields. I retrieve a standard UNIX timestamp from the
      > server and try to insret it into the fields, but it just keeps coming
      > up 00000000000000.
      >
      > Here is the query string I use. The timestamps are the two values
      > right after the e-mail address:
      >
      > insert into remind values
      > (0, 'Firstname', 'lastname', 'jephmat@...', 1098135493,
      > 1095802693, '1990-1-12', 4);
      >
      > But it keeps coming up 00000000000000! The first timestamp has been
      > altered by subtracting 86400. (Second in a day.) The second
      > timestamp is completely unaltered, having been acquired directly off
      > of the server.
      >
      > Should I try using a different data type altogether, or is there some
      > sort of special formatting that must be done for UNIX timestamps?
      >
      > Thanks!
      >
      >


      __________________________________________________
      Do You Yahoo!?
      Tired of spam? Yahoo! Mail has the best spam protection around
      http://mail.yahoo.com
    • Richard Rogers
      Usually sql server keeps track of the timestamp on it s own and it is not intended for manipulation. I suggest inserting those two values into fields of their
      Message 2 of 5 , Sep 22, 2004
      • 0 Attachment
        Message
        Usually sql server keeps track of the timestamp on it's own and it is not intended for manipulation.  I suggest inserting those two values into fields of their own in your table.
        -----Original Message-----
        From: Michael Brinkley [mailto:mbrink1111@...]
        Sent: Wednesday, September 22, 2004 11:23
        To: SQLQueriesNoCode@yahoogroups.com
        Subject: Re: [SQLQueriesNoCode] Trouble inserting a timestamp!
        Importance: Low

        Maybe use single quotes around the values???

        What I do for adding a time stamp is to make the TimeStamp a date field and
        making the default getdate().

        Works for me.

        --- jephmat@... wrote:

        > I have fashioned an SQL insert for a database that contains two
        > TIMESTAMP fields.  I retrieve a standard UNIX timestamp from the
        > server and try to insret it into the fields, but it just keeps coming
        > up 00000000000000.
        >
        > Here is the query string I use.  The timestamps are the two values
        > right after the e-mail address:
        >
        > insert into remind values
        > (0, 'Firstname', 'lastname', 'jephmat@...', 1098135493,
        > 1095802693, '1990-1-12', 4);
        >
        > But it keeps coming up 00000000000000!   The first timestamp has been
        > altered by subtracting 86400. (Second in a day.)  The second
        > timestamp is completely unaltered, having been acquired directly off
        > of the server.
        >
        > Should I try using a different data type altogether, or is there some
        > sort of special formatting that must be done for UNIX timestamps?
        >
        > Thanks!
        >
        >


        __________________________________________________
        Do You Yahoo!?
        Tired of spam?  Yahoo! Mail has the best spam protection around
        http://mail.yahoo.com

        NOTICE: This e-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure, or distribution is prohibited. The contents of this e-mail are confidential. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. Please virus check all attachments to prevent widespread contamination and corruption of files and operating systems!
      Your message has been successfully submitted and would be delivered to recipients shortly.