VB报错index must be greater than zero and less than or equal t
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/11/06 08:37:47
VB报错index must be greater than zero and less than or equal to count
sql = "Insert into HaiTian (加工号,工件号,程序号,开始日期,开始时间,状态)" & _
" VALUES( '" & MachineName & "','" & Numbe & "','" & _
ProgramName & "','" & Date & "','" & Time & _
"','未完成')"
帮我看下,怎么一运行就报这个错!
sql = "Insert into HaiTian (加工号,工件号,程序号,开始日期,开始时间,状态)" & _
" VALUES( '" & MachineName & "','" & Numbe & "','" & _
ProgramName & "','" & Date & "','" & Time & _
"','未完成')"
帮我看下,怎么一运行就报这个错!
你把sql打印出来看看是什么.初步怀疑是类型和DB定义的不一致导致的.
再问: 额,看了下,确实是类型没对上。
再问下比如我有两个时间的字符串:
DateTime1 = "2011年6月27日 6:52:22"
DateTime2 = “2011年6月28日 13:52:14"
我怎么求出这两个时间的中间时长
再答: 如果是sql的话,可以使用datediff函数
如果是oracle的话,可以使用下面的sql。
select floor(to_number(sysdate-to_date('2007-11-02 15:55:03','yyyy-mm-dd hh24:mi:ss'))/365) as spanYears from dual //??差-年
select ceil(moths_between(sysdate-to_date('2007-11-02 15:55:03','yyyy-mm-dd hh24:mi:ss'))) as spanMonths from dual //??差-月
select floor(to_number(sysdate-to_date('2007-11-02 15:55:03','yyyy-mm-dd hh24:mi:ss'))) as spanDays from dual //??差-天
select floor(to_number(sysdate-to_date('2007-11-02 15:55:03','yyyy-mm-dd hh24:mi:ss'))*24) as spanHours from dual //??差-?
select floor(to_number(sysdate-to_date('2007-11-02 15:55:03','yyyy-mm-dd hh24:mi:ss'))*24*60) as spanMinutes from dual //??差-分
select floor(to_number(sysdate-to_date('2007-11-02 15:55:03','yyyy-mm-dd hh24:mi:ss'))*24*60*60) as spanSeconds from dual //??差-秒
再问: 额,看了下,确实是类型没对上。
再问下比如我有两个时间的字符串:
DateTime1 = "2011年6月27日 6:52:22"
DateTime2 = “2011年6月28日 13:52:14"
我怎么求出这两个时间的中间时长
再答: 如果是sql的话,可以使用datediff函数
如果是oracle的话,可以使用下面的sql。
select floor(to_number(sysdate-to_date('2007-11-02 15:55:03','yyyy-mm-dd hh24:mi:ss'))/365) as spanYears from dual //??差-年
select ceil(moths_between(sysdate-to_date('2007-11-02 15:55:03','yyyy-mm-dd hh24:mi:ss'))) as spanMonths from dual //??差-月
select floor(to_number(sysdate-to_date('2007-11-02 15:55:03','yyyy-mm-dd hh24:mi:ss'))) as spanDays from dual //??差-天
select floor(to_number(sysdate-to_date('2007-11-02 15:55:03','yyyy-mm-dd hh24:mi:ss'))*24) as spanHours from dual //??差-?
select floor(to_number(sysdate-to_date('2007-11-02 15:55:03','yyyy-mm-dd hh24:mi:ss'))*24*60) as spanMinutes from dual //??差-分
select floor(to_number(sysdate-to_date('2007-11-02 15:55:03','yyyy-mm-dd hh24:mi:ss'))*24*60*60) as spanSeconds from dual //??差-秒
VB报错index must be greater than zero and less than or equal t
英语翻译Equals,Does not equal,Is greater than,Is greater than or
please enter a real number less than or equal to
英语翻译is greater than or gquan to is less than or eauan to
start time must be less than end
7 less than −2 times a number x is greater than or equ
Your sister will be here in less than an hour and we must be
一道sat数学题how many integers greater than 20 and less than 30 a
the stated number is less than zero or that the second numbe
Please enter an amount greater than zero中文
How many positive integers greater then 5 and less than 500
英语翻译We are two numbers that are greater than 50 and less tha