|
 |
access_asp thread: error in sql query
Message #1 by "asif hameed" <asifqua@h...> on Wed, 10 Jul 2002 15:09:45 +0000
|
|
<html><div style='background-color:'><DIV>
<DIV>
<DIV>
<DIV>
<DIV>
<DIV>
<DIV>hi all</DIV>
<DIV>i m facing a problem wile trying to get information from a table between two dates.<BR>i have a field name idate
,sdate and edate are the variables which r containing starting and ending dates.</DIV>
<DIV>when i m executing query then it is giving error.<BR>my query is :<BR>com.CommandText="select * from
candidate where idate between '"&sdate &"' and '"& edate &"';"</DIV>
<DIV>it gives the floowoing error</DIV>
<DIV>Error Type:<BR>Microsoft JET Database Engine (0x80040E07)<BR>Data type mismatch in criteria
expression.<BR>/project/inqviewdata.asp, line 23</DIV>
<DIV>plz help me for solving this problem<BR>thanks <BR>asif hameed</DIV>
<DIV> </DIV>
<DIV> </DIV></DIV></DIV></DIV></DIV></DIV></DIV></div><br
clear=all><hr>Join the world?s largest e-mail service with MSN Hotmail. <a
href='http://g.msn.com/1HM1ENXX/c157??PI=31901'>Click Here</a><br></html>
Message #2 by bayou_ranch@m... on Wed, 10 Jul 2002 17:26:08
|
|
Try this:
#" & sdate & "#
in place of this
'"&sdate &"'
and the same with the second date:
Good Luck
> <html><div style='background-color:'><DIV>
<DIV>
<DIV>
<DIV>
<DIV>
<DIV>
<DIV>hi all</DIV>
<DIV>i m facing a problem wile trying to get information from a table
between two dates.<BR>i have a field name idate ,sdate and edate are the
variables which r containing starting and ending dates.</DIV>
<DIV>when i m executing query then it is giving error.<BR>my query
is :<BR>com.CommandText="select * from candidate where idate
between '"&sdate &"' and '"& edate &"';"</DIV>
<DIV>it gives the floowoing error</DIV>
<DIV>Error Type:<BR>Microsoft JET Database Engine (0x80040E07)<BR>Data
type mismatch in criteria expression.<BR>/project/inqviewdata.asp, line
23</DIV>
<DIV>plz help me for solving this problem<BR>thanks <BR>asif hameed</DIV>
<DIV> </DIV>
<DIV> </DIV></DIV></DIV></DIV></DIV></DIV></DIV></div><br
clear=all><hr>Join the world?s largest e-mail service with MSN Hotmail. <a
href='http://g.msn.com/1HM1ENXX/c157??PI=31901'>Click Here</a><br></html>
|
|
 |