Results 1 to 4 of 4

Thread: PLS help with date query

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2002
    Location
    Cape Town, SA
    Posts
    144

    PLS help with date query

    Hi
    I have a date field in my sql 2000 DB called "dttripstart" It the following value:"2000-11-22 06:39:49.000" I am trying to do a select statement where dttripstart = '2000-11-22 ' How do I specify this?
    Thanking you in advance
    PORRASTAR

  2. #2
    New Member
    Join Date
    Sep 2002
    Location
    istanbul,turkiye
    Posts
    3
    you can use this in ado:

    strSQL="SELECT * FROM TableName WHERE dttripstart=#'2000-11-22#

    rs.open strSQL,connection,---,---,----

  3. #3
    Hyperactive Member
    Join Date
    Jan 2002
    Location
    The Netherlands
    Posts
    425
    Maybe you can also place the LIKE operator in the SQL string...
    "Experience is something you don't get until just after you need it."

  4. #4
    PowerPoster BruceG's Avatar
    Join Date
    May 2000
    Location
    New Jersey (USA)
    Posts
    2,657
    In SQL Server 2000, use the CONVERT function to chop off the time:
    SELECT * FROM TableName WHERE dttripstart = CONVERT(CHAR(10), DateCreated, 102) = '11/22/2000'
    "It's cold gin time again ..."

    Check out my website here.

Posting Permissions

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



Click Here to Expand Forum to Full Width