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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with Dates in a Input Box

Status
Not open for further replies.

Dynapen

Programmer
Apr 20, 2000
245
US
I have a webpage that i am running, and i am having some problems with a login procedure. On the page, i have a entry box, where you would enter a Username or Password. The data in the box is being chekced against a Access database. One of the fields that they are inputting is a date. If I tell the webpage that it is Input TYPE=&quot;text&quot;,and set the field in access to a text field it works fine. The problem is that i need to set both the webpage and the database to see it as a date so that i can use a different format for the date other than MM/DD/YY.<br><br>I know how to set the properties for the access field, that is easy. But i can't figure out how to set it in the webpage.&nbsp;&nbsp;&nbsp;Ideally i want them to enter the date in YYMMDD format. <br><br>If anyone knows how to do this, please help me out.....<br><br><br>Thanks<br><br>Dynapen
 
First of all, What is the field type of the date field.<br>It's alway's best to make it Date type so you can add or subtract days if need be in the future. Don't make it a text type.<br>Next I have had best results inputing a date field to and Access database like so<br>=format(Mydate, &quot;mm/dd/yy&quot;)<br>Another thing to try is forcing it to be date with pound symbols around it.<br><br>= #07/10/00#<br><br>If you want to see the date another way, format the output not the input. <p>DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br> Ask me how Bar-codes can help you be more productive.
 
All i need to do is set the input box on the frontpage webpage so that it is in a date format. When i try to set it as one, or when i set the access database as a date i get the following error message. <br><br><br>Microsoft JET Database Engine error '80040e07' <br><br>Data type mismatch in criteria expression. <br><br>/chklogin2.asp, line 10 <br><br><br><br>This is the coding behind the input box on the web page<br><br>&lt;tr&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td bgcolor=&quot;#006600&quot; width=&quot;108&quot; align=&quot;center&quot;&gt;&lt;font color=&quot;#FFFFFF&quot;&gt;&lt;b&gt;DOB&lt;/b&gt;&lt;/font&gt;&lt;/td&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td align=&quot;center&quot; width=&quot;262&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;&lt;input TYPE=&quot;Date&quot; NAME=&quot;DOB&quot; SIZE=&quot;10&quot;&gt;&lt;/font&gt;&lt;/td&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td align=&quot;center&quot; width=&quot;261&quot;&gt;M/D/YY Format  <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(1/1/99    10/2/99)&lt;/td&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<br><br><br>And finally the coding behind the page that is actually sending the input to the database.<br><br><br>&lt;%<br>dim strSSN, strAFADBD, strDOB<br>strSSN = Request(&quot;SSN&quot;)<br>strAFADBD = Request(&quot;AFADBD&quot;)<br>strDOB = Request(&quot;DOB&quot;) <br><br>dim sql<br>sql = &quot;SELECT * FROM IndivAccess WHERE SSN = '&quot; & strSSN & &quot;' and AFADBD='&quot; & strAFADBD & &quot;' and DOB = '&quot; & strDOB & &quot;';&quot;<br>RSUD.Open sql, ConnUD<br><br>if RSUD.EOF then 'User was found - check password<br>RSUD.close<br>set RSUD=nothing<br>else<br><br>Response.Cookies(&quot;SSN&quot;)=RSUD(&quot;SSN&quot;)<br>RSUD.close<br>set RSUD=nothing<br>Response.Redirect &quot;frame_Indiv/frame_page_indiv.asp&quot;<br><br>end if<br>%&gt;<br><br><br><br>All i am trying to do is get the input box, labeled DOB (Date of Birth) to connect to the access database as a Date field, as opposed to a text field. Preferably in YYMMDD format. <br><br>I am lost on this one. I would appreciate the help<br><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top