Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21848

[RESOLVED] help: inserting mysql date

$
0
0
good day guys.

i have this example code:

Code:

dim str1 as string
str1="update table1 set transdate=" & Date
cn.execute str1

the problem now is when I check the record transdate, the data is 0000-00-00, so I guess it was not saved properly.
i tried the next code:

Code:

dim str1 as string
str1="update table1 set transdate=" & format(Date,"yyyy-mm-dd")
cn.execute str1

but now I get error "Incorrect date value: '2004' for column transdate' at row 1

Please help correct the code. thanks.

Viewing all articles
Browse latest Browse all 21848

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>