date中的记录格式为2004-1-10 12:43:22~
比如现在是2004-1-10 8:33:22,那么要查的就是 2004-1-9 10:00:00 到2004-1-10 8:33:22只见的记录~
如果现在是2004-1-14 20:43:12,那么要查的是 2004-1-13 10:00:00 到2004-1-14 10:00:00~~
谢谢各位~
20 个解决方案
#1
select * from [booking] where [date] between Between DateAdd("d",-1,Date())+#10:0:0# And IIf(Now()<=Date()+#10:0:0#,Now(),Date()+#10:0:0#)
上述代码只适用于Access环境,
vb+mdb asp+mdb都不适用
上述代码只适用于Access环境,
vb+mdb asp+mdb都不适用
#2
有用于asp+mdb的么?
#3
用VBS代替 JET SQL IIF判断即可,没什么难的啊?
#4
select * from [booking] where [date] between Between DateAdd("d",-1,Date())+#10:0:0# And IIf(Now()<=Date()+#10:0:0#,Now(),Date()+#10:0:0#)
<%
dim strsql
dim date1
dim date2
if Now<=cdate(date() & " 10:0:0") then
date1=now()
else
date2=date() & " 10:0:0"
end if
strsql="select * from [booking] where [date] between #" & date1 & "# and #" &date2 &"#"
<%
dim strsql
dim date1
dim date2
if Now<=cdate(date() & " 10:0:0") then
date1=now()
else
date2=date() & " 10:0:0"
end if
strsql="select * from [booking] where [date] between #" & date1 & "# and #" &date2 &"#"
#5
<%
dim strsql
dim date1
dim date2
if Now<=cdate(date() & " 10:0:0") then
date1=now()
else
date2=date() & " 10:0:0"
end if
strsql="select * from [booking] where [date] between #" & date1 & "# and #" &date2 &"#"
.....
%>
dim strsql
dim date1
dim date2
if Now<=cdate(date() & " 10:0:0") then
date1=now()
else
date2=date() & " 10:0:0"
end if
strsql="select * from [booking] where [date] between #" & date1 & "# and #" &date2 &"#"
.....
%>
#6
上面DATE1忘记赋值了,看这个
<%
dim date1
dim date2
date1=DateAdd("d",-1,Date()) & " 10:0:0"
if Now<=cdate(date() & " 10:0:0") then
date2=now()
else
date2=date() & " 10:0:0"
end if
strsql="select * from [booking] where [date] between #" & date1 & "# and #" &date2 &"#"
...
%>
<%
dim date1
dim date2
date1=DateAdd("d",-1,Date()) & " 10:0:0"
if Now<=cdate(date() & " 10:0:0") then
date2=now()
else
date2=date() & " 10:0:0"
end if
strsql="select * from [booking] where [date] between #" & date1 & "# and #" &date2 &"#"
...
%>
#7
Set conn=Server.CreateObject("ADODB.CONNECTION")
Set rs=Server.CreateObject("ADODB.RecordSet")
conn.open usermdb
date1=DateAdd("d",-1,Date()) & " 10:00:00"
if Now<=cdate(date() & " 10:00:00") then
date2=now()
else
date2=date() & " 10:00:00"
end if
sql = "SELECT * FROM [booking] WHERE [预约确认时间] BETWEEN #" & date1 & "# AND #" & date2 &"#"
response.write sql
rs.open sql,conn,1,3
===================
SELECT * FROM [booking] WHERE [预约确认时间] BETWEEN #2004-1-16 10:00:00# AND #2004-1-17 10:00:00#
Microsoft JET Database Engine 错误 '80040e10'
至少一个参数没有被指定值。
/blt/admin/NewBook.asp,行 41
Set rs=Server.CreateObject("ADODB.RecordSet")
conn.open usermdb
date1=DateAdd("d",-1,Date()) & " 10:00:00"
if Now<=cdate(date() & " 10:00:00") then
date2=now()
else
date2=date() & " 10:00:00"
end if
sql = "SELECT * FROM [booking] WHERE [预约确认时间] BETWEEN #" & date1 & "# AND #" & date2 &"#"
response.write sql
rs.open sql,conn,1,3
===================
SELECT * FROM [booking] WHERE [预约确认时间] BETWEEN #2004-1-16 10:00:00# AND #2004-1-17 10:00:00#
Microsoft JET Database Engine 错误 '80040e10'
至少一个参数没有被指定值。
/blt/admin/NewBook.asp,行 41
#8
SELECT * FROM [booking] WHERE [预约确认时间] BETWEEN '2004-1-16 10:00:00' AND '2004-1-17 10:00:00'
是否可行?
是否可行?
#9
还是那个错误呀~怎么回事呢?
#10
一般是SQL语句错误,确定字段都没错嘛?
#11
#12
都没错阿~
怎么样才算错呢?
response.write sql
输出SQL语句没问题~
怎么样才算错呢?
response.write sql
输出SQL语句没问题~
#13
select * from table where date between #2003-01-01# and #2004-01-01#
#14
把时间转换成整形!
#15
关注中。
#16
upup~
#17
还是有点不太明白的地方,还要向各位学习学习!!1
#18
Access的时间查询在视图可以正常,但在程序中老是提示“Parameter对象被不正确定义。提供了不一致或不完整的信息。”
SQL语句如下
select * from roomrecord where startime>#2003-12-18 17:40:00#
最后,我是将查询改为如下才可以
select * from roomrecord where startime>37979.75
也就是将日期型比较浮点数才可以,算不算是Access的一个Bug.
但单单比较日期是没问题的。如下面就没问题
select * from roomrecord where startime>#2003-12-18#
我用的是BC6+ADO
SQL语句如下
select * from roomrecord where startime>#2003-12-18 17:40:00#
最后,我是将查询改为如下才可以
select * from roomrecord where startime>37979.75
也就是将日期型比较浮点数才可以,算不算是Access的一个Bug.
但单单比较日期是没问题的。如下面就没问题
select * from roomrecord where startime>#2003-12-18#
我用的是BC6+ADO
#19
上面原来是BC6 ADOQuery的参数检查问题,不关Access的事
#20
Dim H, D1, D2, SQL
H = Hour(Now)
D1= dateadd("d", -1, date) & " 10:00:00"
if H < 10 then
D2 = Now
else
D2 = Date & " 10:00:00"
end if
SQL = "select * from [booking] where 预约确认时间 between #"+ D1 +"# and #"+ D2 +"#"
response.write SQL
rs.open SQL,conn,1,3
输出结果:
select * from [booking] where 预约确认时间 between #2004-2-2 10:00:00# and #2004-2-3 10:00:00#
Microsoft JET Database Engine 错误 '80040e10'
至少一个参数没有被指定值。
/blt/admin/NewBook.asp,行 46
======================
怎么换SQL语句它还是'80040e10' 这个错误,至少一个参数没有被指定~
我想可能不是SQL语句的问题,使我IIS哪里没有设置好?还是ACCESS数据库哪里没有设置好?
H = Hour(Now)
D1= dateadd("d", -1, date) & " 10:00:00"
if H < 10 then
D2 = Now
else
D2 = Date & " 10:00:00"
end if
SQL = "select * from [booking] where 预约确认时间 between #"+ D1 +"# and #"+ D2 +"#"
response.write SQL
rs.open SQL,conn,1,3
输出结果:
select * from [booking] where 预约确认时间 between #2004-2-2 10:00:00# and #2004-2-3 10:00:00#
Microsoft JET Database Engine 错误 '80040e10'
至少一个参数没有被指定值。
/blt/admin/NewBook.asp,行 46
======================
怎么换SQL语句它还是'80040e10' 这个错误,至少一个参数没有被指定~
我想可能不是SQL语句的问题,使我IIS哪里没有设置好?还是ACCESS数据库哪里没有设置好?
#21
#1
select * from [booking] where [date] between Between DateAdd("d",-1,Date())+#10:0:0# And IIf(Now()<=Date()+#10:0:0#,Now(),Date()+#10:0:0#)
上述代码只适用于Access环境,
vb+mdb asp+mdb都不适用
上述代码只适用于Access环境,
vb+mdb asp+mdb都不适用
#2
有用于asp+mdb的么?
#3
用VBS代替 JET SQL IIF判断即可,没什么难的啊?
#4
select * from [booking] where [date] between Between DateAdd("d",-1,Date())+#10:0:0# And IIf(Now()<=Date()+#10:0:0#,Now(),Date()+#10:0:0#)
<%
dim strsql
dim date1
dim date2
if Now<=cdate(date() & " 10:0:0") then
date1=now()
else
date2=date() & " 10:0:0"
end if
strsql="select * from [booking] where [date] between #" & date1 & "# and #" &date2 &"#"
<%
dim strsql
dim date1
dim date2
if Now<=cdate(date() & " 10:0:0") then
date1=now()
else
date2=date() & " 10:0:0"
end if
strsql="select * from [booking] where [date] between #" & date1 & "# and #" &date2 &"#"
#5
<%
dim strsql
dim date1
dim date2
if Now<=cdate(date() & " 10:0:0") then
date1=now()
else
date2=date() & " 10:0:0"
end if
strsql="select * from [booking] where [date] between #" & date1 & "# and #" &date2 &"#"
.....
%>
dim strsql
dim date1
dim date2
if Now<=cdate(date() & " 10:0:0") then
date1=now()
else
date2=date() & " 10:0:0"
end if
strsql="select * from [booking] where [date] between #" & date1 & "# and #" &date2 &"#"
.....
%>
#6
上面DATE1忘记赋值了,看这个
<%
dim date1
dim date2
date1=DateAdd("d",-1,Date()) & " 10:0:0"
if Now<=cdate(date() & " 10:0:0") then
date2=now()
else
date2=date() & " 10:0:0"
end if
strsql="select * from [booking] where [date] between #" & date1 & "# and #" &date2 &"#"
...
%>
<%
dim date1
dim date2
date1=DateAdd("d",-1,Date()) & " 10:0:0"
if Now<=cdate(date() & " 10:0:0") then
date2=now()
else
date2=date() & " 10:0:0"
end if
strsql="select * from [booking] where [date] between #" & date1 & "# and #" &date2 &"#"
...
%>
#7
Set conn=Server.CreateObject("ADODB.CONNECTION")
Set rs=Server.CreateObject("ADODB.RecordSet")
conn.open usermdb
date1=DateAdd("d",-1,Date()) & " 10:00:00"
if Now<=cdate(date() & " 10:00:00") then
date2=now()
else
date2=date() & " 10:00:00"
end if
sql = "SELECT * FROM [booking] WHERE [预约确认时间] BETWEEN #" & date1 & "# AND #" & date2 &"#"
response.write sql
rs.open sql,conn,1,3
===================
SELECT * FROM [booking] WHERE [预约确认时间] BETWEEN #2004-1-16 10:00:00# AND #2004-1-17 10:00:00#
Microsoft JET Database Engine 错误 '80040e10'
至少一个参数没有被指定值。
/blt/admin/NewBook.asp,行 41
Set rs=Server.CreateObject("ADODB.RecordSet")
conn.open usermdb
date1=DateAdd("d",-1,Date()) & " 10:00:00"
if Now<=cdate(date() & " 10:00:00") then
date2=now()
else
date2=date() & " 10:00:00"
end if
sql = "SELECT * FROM [booking] WHERE [预约确认时间] BETWEEN #" & date1 & "# AND #" & date2 &"#"
response.write sql
rs.open sql,conn,1,3
===================
SELECT * FROM [booking] WHERE [预约确认时间] BETWEEN #2004-1-16 10:00:00# AND #2004-1-17 10:00:00#
Microsoft JET Database Engine 错误 '80040e10'
至少一个参数没有被指定值。
/blt/admin/NewBook.asp,行 41
#8
SELECT * FROM [booking] WHERE [预约确认时间] BETWEEN '2004-1-16 10:00:00' AND '2004-1-17 10:00:00'
是否可行?
是否可行?
#9
还是那个错误呀~怎么回事呢?
#10
一般是SQL语句错误,确定字段都没错嘛?
#11
#12
都没错阿~
怎么样才算错呢?
response.write sql
输出SQL语句没问题~
怎么样才算错呢?
response.write sql
输出SQL语句没问题~
#13
select * from table where date between #2003-01-01# and #2004-01-01#
#14
把时间转换成整形!
#15
关注中。
#16
upup~
#17
还是有点不太明白的地方,还要向各位学习学习!!1
#18
Access的时间查询在视图可以正常,但在程序中老是提示“Parameter对象被不正确定义。提供了不一致或不完整的信息。”
SQL语句如下
select * from roomrecord where startime>#2003-12-18 17:40:00#
最后,我是将查询改为如下才可以
select * from roomrecord where startime>37979.75
也就是将日期型比较浮点数才可以,算不算是Access的一个Bug.
但单单比较日期是没问题的。如下面就没问题
select * from roomrecord where startime>#2003-12-18#
我用的是BC6+ADO
SQL语句如下
select * from roomrecord where startime>#2003-12-18 17:40:00#
最后,我是将查询改为如下才可以
select * from roomrecord where startime>37979.75
也就是将日期型比较浮点数才可以,算不算是Access的一个Bug.
但单单比较日期是没问题的。如下面就没问题
select * from roomrecord where startime>#2003-12-18#
我用的是BC6+ADO
#19
上面原来是BC6 ADOQuery的参数检查问题,不关Access的事
#20
Dim H, D1, D2, SQL
H = Hour(Now)
D1= dateadd("d", -1, date) & " 10:00:00"
if H < 10 then
D2 = Now
else
D2 = Date & " 10:00:00"
end if
SQL = "select * from [booking] where 预约确认时间 between #"+ D1 +"# and #"+ D2 +"#"
response.write SQL
rs.open SQL,conn,1,3
输出结果:
select * from [booking] where 预约确认时间 between #2004-2-2 10:00:00# and #2004-2-3 10:00:00#
Microsoft JET Database Engine 错误 '80040e10'
至少一个参数没有被指定值。
/blt/admin/NewBook.asp,行 46
======================
怎么换SQL语句它还是'80040e10' 这个错误,至少一个参数没有被指定~
我想可能不是SQL语句的问题,使我IIS哪里没有设置好?还是ACCESS数据库哪里没有设置好?
H = Hour(Now)
D1= dateadd("d", -1, date) & " 10:00:00"
if H < 10 then
D2 = Now
else
D2 = Date & " 10:00:00"
end if
SQL = "select * from [booking] where 预约确认时间 between #"+ D1 +"# and #"+ D2 +"#"
response.write SQL
rs.open SQL,conn,1,3
输出结果:
select * from [booking] where 预约确认时间 between #2004-2-2 10:00:00# and #2004-2-3 10:00:00#
Microsoft JET Database Engine 错误 '80040e10'
至少一个参数没有被指定值。
/blt/admin/NewBook.asp,行 46
======================
怎么换SQL语句它还是'80040e10' 这个错误,至少一个参数没有被指定~
我想可能不是SQL语句的问题,使我IIS哪里没有设置好?还是ACCESS数据库哪里没有设置好?