Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Database and Reporting > set null as value in date


Reply
 
Thread Tools Display Modes
  #1  
Old 07-13-2006, 05:12 AM
ghoti ghoti is offline
Senior Contributor
 
Join Date: Jun 2003
Posts: 818
Default set null as value in date


Hi folks,

I'm using a MSDE 2000 database and i was wondering how you can delete a date recordvalue?

if i remember correctly you can't save a null value to the record. But what if the data i have entered wasn't for that field?

let me explain, I have a field BirthDate and a field PresentDate, what if i have by mistake filled in the present date in the birthdate but i want the birthdate to be empty? how can i save an empty date into a datefield so that the old date will be gone and no other date is in its place?

greets ghoti
__________________
Let is snow, let it snow, let it snow
Reply With Quote
  #2  
Old 07-13-2006, 06:45 AM
Topgrob Topgrob is offline
Centurion
 
Join Date: Nov 2005
Location: Canterbury, Kent, UK
Posts: 102
Default

Not overly up on MSDE but...
Could try
field("DoB").value=Null
??
Or look to see if the field in the database is set to allow nulls?
__________________
Jealousy is all the fun you think they had
Reply With Quote
  #3  
Old 07-13-2006, 07:37 AM
shettydatta shettydatta is offline
Centurion
 
Join Date: Aug 2005
Posts: 158
Default

Hi,
Can you not Update the Date = NULL in Query Analyzer ?

Code:
 
update <tableName> 
set BirthDate = NULL 
where BirthDate = <value>

Datta
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->