刚问了个问题,多谢朋友们的帮助,现在又碰到麻烦了我想在两个文本框里输入日期和时间
比如 text1.text="2003-4-8"
text2.text="14:00:00"
然后想把这两个字串组合成一个日期
也就是Date类型的 2003-4-8 14:00:00请问这该如何得到?!谢谢了然后再和ACCESS里的数据进行比较
那里的存储格式是DATE/TIME型 2003-4-8 14:00:00

解决方案 »

  1.   

    d=format(text1.text & " " & text1.text,"yyyy-mm-dd hh:mm:ss"
      

  2.   

    CDate(text1.text & text2.text)
      

  3.   

    直接字符串连接就可以了,用连接符 &
    和ACCESS里的数据进行比较时要在两端加#
      

  4.   

    dim s as string 
    s=text1.text &" " & text2.text
    dim d as date
    d=format(s,"yyyy mm dd hh:mm:ss")
      

  5.   

    dim date1
    date1=text1.text & text2.text
    例如sql="select * from table1 where thedate > '#" & date1 & "#'"
      

  6.   

    MsgBox Format(Text1.Text & " " & Text2.Text, "yyyy-mm-dd hh:mm:ss")
      

  7.   

    date1=text1.text &" " & text2.text
      

  8.   

    cmd.CommandText = "select * from  测试记录表 where ID_Machine= " & oPhone & " AND Time_Test>#" & strTimeBegin & "# AND Time_Test< #" & strTimeEnd & "#"这是我写的,明明有记录,可是为什么一条都查不出来呢?!