This topic has been archived. It cannot be replied.
-
工作学习 / IT技术讨论 / What is the correct sql statement in ACCESS?I want to select data from a table
select * from transactions where date='11/19/2002' (the system give me a "type mismatch" error)
select * from transactons where date=11/18/2002 ( NO error now, but no result went out)
-oceandeep(北极熊® Zzz Zzz);
2002-11-19
{230}
(#863560@0)
-
Don't use date as column name, it seems to be a key word.
If you want use it like where 'date'='xxx'
-curtwu(清扬);
2002-11-19
(#863644@0)
-
sorry, I haven't used the "date" as a column, so is the statement inside correct?select * from transactions where transdate='11/18/2002'
if it is, but why I got an error message.
-oceandeep(北极熊® Zzz Zzz);
2002-11-19
{102}
(#864186@0)
-
使用函数转换数据类型。select * from transactions where transdate=todate('11/18/2002' )
-lilyba(Sunshine);
2002-11-19
(#864201@0)
-
Big sister :) but I wanna use it in VB script. I built a ADODC to connect the access DB. But the sentence up doesn't work
-oceandeep(北极熊® Zzz Zzz);
2002-11-19
(#864231@0)
-
try format("01/01/1999", "mm-dd-yyyy"),你试试,我忘记具体的格式了。
-lilyba(Sunshine);
2002-11-19
(#864241@0)
-
Thank you !!! Sister!!! Good Day
-oceandeep(北极熊® Zzz Zzz);
2002-11-19
(#864263@0)
-
date sign is #.should beselect * from transactons where date=#11/18/2002#
-goodbaby(小宝);
2002-11-19
{49}
(#864248@0)
-
Great!!!! You are right!!!! Thank you!!! So many delimiters to be remembered
-oceandeep(北极熊® Zzz Zzz);
2002-11-19
(#864261@0)
-
Use ##, eg. #11/09/2002#
-jeffrey815(Smartiecat);
2002-11-19
(#864306@0)
-
select * from transactions where [date]=#11/19/2002#
or
select * from transactions where [date]=cdate("11/19/2002")
-mikesxf(家里家外忙前忙后ing.);
2002-11-20
(#866237@0)