Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2004
    Posts
    77

    Angry Unanswered: Use time in Sql (Problem)

    I have table name AAA.
    Id ti
    1 9:00:01AM
    2 10:00:01AM
    3 10:12:45AM
    4 10:30:01AM

    The type of time that I use in column ti is date/time hh:nn:ssAM/PM

    <!--#include file="connect.asp"-->
    <%
    sql="select * from AAA where ti < '10:00:03AM' "
    set rst5=server.createobject("adodb.recordset")
    rst5.open sql,conn,1,3
    if not rst5.eof then
    response.write "OK"
    end if
    %>

    When I run this code I got message "Data type missmatch"
    Then I tried ti < 10:00:03AM It still didn't work!

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    microsoft access?

    try where ti < #10:00:03AM#
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Aug 2004
    Posts
    77
    Thank. It work.
    But I still have question ?????
    Assume that all of time was kept in variable which is array like this

    tiorder2(t2)=rst5("tiorder")
    tiorder2(t2)
    How can I write it....

    sql="select top 1 * from ("&namecompany2(i2)&") where price <= "&limitprice2(j2)&" and ti > #&tiorder2(t2)&#"

    Not work

    Note that tiorder2(t2) keep time

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    i have no idea

    perhaps you could ask that question in the ASP forum
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

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