Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Querying Date using a Form

Status
Not open for further replies.

auriga69

Technical User
Feb 11, 2001
9
0
0
CL
I try to do this thing and tried in several ways. Can you help me. The matter is the following: My database is in acces and the date and hour field is the same in access is not text.
Here's the code:

====Form page=====
<form action=&quot;flotadia.cfm?info_fecha='#info_fecha#'&cfid=#cfid#&cftoken=#cftoken#&quot; method=&quot;post&quot;>
<div align=&quot;center&quot;>
<input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;Buscar&quot;>
<input type=&quot;text&quot; name=&quot;info_fecha&quot;>
<span class=&quot;etiketas&quot;>(dd-mm-aaaa)</span></div></form>


=======flotadia.cfm=======
<cfquery name=&quot;dia&quot; datasource=&quot;datasource&quot;>
select * from tb_informe where info_fecha=#form.info_fecha# order by info_fecha,info_hora asc
</cfquery>
<div class=&quot;comuna&quot;>
<cfoutput query=&quot;dia&quot; >#info_fecha#</cfoutput>
</div>
<cfoutput query=&quot;dia&quot;>
<p class=&quot;campos&quot;>#info_hora# </p>
#info_posicion#
#info_velocidad#
#info_direccion#
</cfoutput>

When I put the date in the search form like dd-mm-yyyy, nothing happens in the search and don't pick up the field.
What am I doing wrong???

:-I
 
You might want to make the submitted field into a date.
Something like :
<cfquery name=&quot;dia&quot; datasource=&quot;datasource&quot;>
select *
from tb_informe
where info_fecha=#ParseDateTime(form.info_fecha)#
order by info_fecha,info_hora asc
</cfquery>

webron
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top