Solved

Urgent : Insert Null into Datetime field

Posted on 2002-03-15
5
340 Views
Last Modified: 2008-02-01
Hi All,

How do I insert Null value into datetime field from
my VB Dll.

Thanks and Regards,
Mukesh
0
Comment
Question by:mukeshkm
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 6867598
The answer depends on the way you are currently working:
* using SQL statements
* using updatable recordsets
* using stored procedures

Please indicate, maybe including your code that doesn't work.

Cheers
0
 

Author Comment

by:mukeshkm
ID: 6867623
Hello angellll

what Iam looking at is inserting a record using
SQL statement in my VB function. A friend of mine
put this question to me. Sorry I donot have the
source ...

Mukesh
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 6867635

sql = "INSERT INTO yourtable (col1, col2, datecol) VALUES ( 1,2, NULL )"

If you have SQL string you want to execute, you give NULL as value (no quotes, no brackets).

CHeers
0
 
LVL 7

Accepted Solution

by:
simonsabin earned 200 total points
ID: 6867983
If you are using a recordset then set the value of the relevant field to vbNull
0
 

Author Comment

by:mukeshkm
ID: 6868042
thanks simonsabin it works

thanks to angelll too

rgds,
mukesh
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question