DateTime always NULL

georgepatotk

Well-known member
Joined
Mar 1, 2004
Messages
431
Location
Malaysia
Mates, I have a problem here, please do me a favor.

I am using MySQL 4.1. And using MySql.Data.MySqlClient as the ado.

Things work very fine. But, recently I found out a problem where from my query, the date value is not stored in the Databases.

My query is as below:

"INSERT INTO tblSales (SalesDate,.....) VALUES (" & datetimepicker1.value & ",...)"

The insertion query runs well, and all the values are stored except SalesDate. I check the databases, it actually store NULL value.

Please do me his favor, tell me why is this happen..
 
The problem is solved.
To share with ur guys, I would like tell the solution here.

From an article, I found out the we need to follow certain date format in order to insert a value into a DataField.

So, what I did is to convert my date into one the formats. (yyyyMMdd)

"INSERT INTO tblSales (SalesDate,.....) VALUES (" & format(datetimepicker1.value,"yyyyMMdd") & ",...)"

So, it is just the date format problem. It tooks me 4 programming hours. DAMN!!!!!
 
Back
Top