Results 1 to 4 of 4

Thread: Date

  1. #1
    Join Date
    Jan 2003
    Posts
    30

    Question Unanswered: Date

    Hello guys!

    I want to record a date (datetime field) with 000 in ms.

    The GetDate() always return 2001-04-15 22:22:53.432 and I need a date like this: 2001-04-15 22:22:53.000

    How to do?

    Thanks in advance.
    Last edited by Loas; 03-07-03 at 15:18.

  2. #2
    Join Date
    Feb 2002
    Location
    Houston, TX
    Posts
    809
    how about:

    select convert(varchar,getdate(),120) + '.000'

    or if you want a datetime

    select cast(convert(varchar,getdate(),120) + '.000' as datetime)
    Paul Young
    (Knowledge is power! Get some!)

  3. #3
    Join Date
    Jan 2003
    Posts
    30

    Perfect

    Originally posted by Paul Young
    how about:

    select convert(varchar,getdate(),120) + '.000'

    or if you want a datetime

    select cast(convert(varchar,getdate(),120) + '.000' as datetime)
    Perfect... thanks Paul.

  4. #4
    Join Date
    Jan 2003
    Posts
    30

    Another one...

    I have a Internet service (ASP+SQL) that have a lot of access.

    I open a table with adOpenForwardOnly, adLockReadOnly to get some data.. But frequentily I receive a follow error msg:

    Number: Microsoft OLE DB Provider for SQL Server
    (0x80004005)
    Your transaction (process ID #36) was deadlocked with another process and has been chosen as the deadlock victim. Rerun your transaction.



    How to avoid this kind of error? How to avoid deadlock?

    Thanks in advance.

Posting Permissions

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