Print Page | Close Window

date/time

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Database Discussion
Forum Description: Discussion and chat on database related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=767
Printed Date: 29 March 2026 at 2:30am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: date/time
Posted By: tomasz
Subject: date/time
Date Posted: 06 March 2003 at 5:13am
Is it possible to leave a "date/time" record blank? 'cause when I do so there's always an error on the ASP webpage.



Replies:
Posted By: michael
Date Posted: 06 March 2003 at 11:47am
Well not knowing what you are really talking about I am just going to assume. If you have an access database with a date/time field you just need to make sure that in the design view it says 'No' to the 'Required' dropdown box. Then you can leave it blank. If you still get an error, there is a prob in your sqlscript, guessing as there might be a value you entered it into a variable to insert into the db, thus when someone leaves it blank it bombs as it tries to insert "Nothing" instead of leaving it NULL


Posted By: tomasz
Date Posted: 06 March 2003 at 1:09pm

It's actually an SQL Database. I'm getting this error when I trie to open the ASP page.

Microsoft VBScript runtime error '800a000d'

Type mismatch: 'FormatDateTime'

/asp/EersteElftal/spelers.asp, line 116

I don't get the error when I fill in a date in the date/time field in the database, just when I leave one blank. These are the options I have when I want to add a column:

Ordinal 6
Name < name=fname>
Data type < =:onFieldChange(this.options[this.edIndex].value); name=> Date/Time Long Integer Text AutoNumber Memo Currency Binary Byte Decimal Double Integer Single Boolean Replication ID
Nullable < = value=-1 name=nullable>
Max. length < size=5 name=length>
Default Value < name=default>
Description < name=deion>
Indexed < name=indexed> No Yes, allow duplicates Yes, unique index
< class= =submit value=Update name=submit>



Posted By: Bunce
Date Posted: 07 March 2003 at 1:15am

Its not the database causing the problem. Its your code.

I'm guessing you are trying to use the 'FormatDateTime' function (as it says in your error message), however you can't format a 'NULL' entry! Hence the error message.

In other words, you need to check to see if it's a null entry (using ISNULL) before you try to FormatDateTime()

Cheers,
Andrew



-------------
There have been many, many posts made throughout the world...
This was one of them.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net