I have a table with the "wrong" sql dateformat.
Can anyone give me a clue to update all records (+10000) with a parameter?
When i do it my way, i get all dates to 00-00-0000
So; my dateformat is "DD-MM-YYYY" and i want to set it to "YYYY-MM-DD"
cmd.CommandText="update line set birthdate='"&ConvertToSQLDate (birthdate)&"'"
cmd.ExecuteNonQuery
End Sub
Private Sub ConvertToSQLDate( DDMMYYYY )
DateFormat( "dd-mm-yyyy" )
Ticks = DateParse( DDMMYYYY )
DateFormat( "yyyy-mm-dd" )
Return Date( Ticks )
End Sub
Can anyone give me a clue to update all records (+10000) with a parameter?
When i do it my way, i get all dates to 00-00-0000
So; my dateformat is "DD-MM-YYYY" and i want to set it to "YYYY-MM-DD"
cmd.CommandText="update line set birthdate='"&ConvertToSQLDate (birthdate)&"'"
cmd.ExecuteNonQuery
End Sub
Private Sub ConvertToSQLDate( DDMMYYYY )
DateFormat( "dd-mm-yyyy" )
Ticks = DateParse( DDMMYYYY )
DateFormat( "yyyy-mm-dd" )
Return Date( Ticks )
End Sub