Urgent : Insert Null into Datetime field

Hi All,

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

Thanks and Regards,
Mukesh
mukeshkmAsked:
Who is Participating?
 
simonsabinConnect With a Mentor Commented:
If you are using a recordset then set the value of the relevant field to vbNull
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
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
 
mukeshkmAuthor Commented:
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
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:

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
 
mukeshkmAuthor Commented:
thanks simonsabin it works

thanks to angelll too

rgds,
mukesh
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.