Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - date/time
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

date/time

 Post Reply Post Reply
Author
tomasz View Drop Down
Newbie
Newbie
Avatar

Joined: 04 March 2003
Location: Belgium
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote tomasz Quote  Post ReplyReply Direct Link To This Post Topic: date/time
    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.
Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
tomasz View Drop Down
Newbie
Newbie
Avatar

Joined: 04 March 2003
Location: Belgium
Status: Offline
Points: 14
Post Options Post Options   Thanks (0) Thanks(0)   Quote tomasz Quote  Post ReplyReply Direct Link To This Post 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>

Back to Top
Bunce View Drop Down
Senior Member
Senior Member
Avatar

Joined: 10 April 2002
Location: Australia
Status: Offline
Points: 846
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bunce Quote  Post ReplyReply Direct Link To This Post 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



Edited by Bunce
There have been many, many posts made throughout the world...
This was one of them.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.