Hi,
Try this
format(now(),date()) give 4/30/98
format(now(),format(time()
Main Topics
Browse All TopicsI am trying to use the now() and/or getdate() functions in an ASP to initialize a text box with today's date. This works fine. I then use a regular HTML submit to pass that date through several ASP's before actually committing it to the database. It looks like it keeps the right format all the way until it writes it to my Access db.
Now I have a field date_out defined in Access as a date/time data type. When I look in how it is stored in db, Access gives it a default time (not even a date even though I have it formatted as short date only). This prevents me from searching on a date and just pulling out that field.
Does anyone have any idea why my date format would be lost in there?
An idea. That the submit of the form loses the date format and converts it to a string. Yet, Access will usually give an error if you try to assign a string to a date type, as it has when I try to explicitly use a string.
Any thoughts on this?
thanks. a.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
You said that you pass it through several ASP's... Is there a way that you can test see if it will commit to the Access DB on the date's first creation from that first ASP? There is a posibility that you are loosing the date format in the transition from one ASP to another. That SHOULDN'T happen, but I have seen more weird things than that. It could be that in the transitions, your date is becoming a string...
SHRUG.. dunno.. I'll try to do something like that and let you know what I find...
Hey,
I have seen this problem many times before...in that ASP, are you sending the Date to the database via a sql command...i.e. as a text string...
If so, you need to have the Date enclosed within pound signs...so basically something liek this...
sqlString = "Insert into ThisTable (MyDate) VALUES (#" & Date() & "#)"
This is How I Do It...
Hope that worked...let me know, because this question deserves more points...
Business Accounts
Answer for Membership
by: sybePosted on 1998-04-29 at 07:09:58ID: 1854341
'Use the ASP Date() function
Today = Date()
I use this function to checkmif a string can be converted to a date:
<%
Function CheckDate(str)
strInput = str
On Error Resume Next
strOutput = CDate(strInput)
If Err <> 0 Then
CheckDate = nothing
Else
CheckDate = strOutput
End If
End Function
%>