×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Problems with Dates in a Input Box

Problems with Dates in a Input Box

Problems with Dates in a Input Box

(OP)
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="text",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.

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.   Ideally i want them to enter the date in YYMMDD format.

If anyone knows how to do this, please help me out.....


Thanks

Dynapen

RE: Problems with Dates in a Input Box

First of all, What is the field type of the date field.
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.
Next I have had best results inputing a date field to and Access database like so
=format(Mydate, "mm/dd/yy")
Another thing to try is forcing it to be date with pound symbols around it.

= #07/10/00#

If you want to see the date another way, format the output not the input.

DougP
dposton@universal1.com

Ask me how Bar-codes can help you be more productive.

RE: Problems with Dates in a Input Box

(OP)
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.


Microsoft JET Database Engine error '80040e07'

Data type mismatch in criteria expression.

/chklogin2.asp, line 10



This is the coding behind the input box on the web page

<tr>
      <td bgcolor="#006600" width="108" align="center"><font color="#FFFFFF"><b>DOB</b></font></td>
      <td align="center" width="262"><font color="#000000"><input TYPE="Date" NAME="DOB" SIZE="10"></font></td>
      <td align="center" width="261">M/D/YY Format  
        (1/1/99    10/2/99)</td>
    </tr>


And finally the coding behind the page that is actually sending the input to the database.


<%
dim strSSN, strAFADBD, strDOB
strSSN = Request("SSN")
strAFADBD = Request("AFADBD")
strDOB = Request("DOB")

dim sql
sql = "SELECT * FROM IndivAccess WHERE SSN = '" & strSSN & "' and AFADBD='" & strAFADBD & "' and DOB = '" & strDOB & "';"
RSUD.Open sql, ConnUD

if RSUD.EOF then 'User was found - check password
RSUD.close
set RSUD=nothing
else

Response.Cookies("SSN")=RSUD("SSN")
RSUD.close
set RSUD=nothing
Response.Redirect "frame_Indiv/frame_page_indiv.asp"

end if
%>



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.

I am lost on this one. I would appreciate the help

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close