Sql2

image
here for variable vstartTime and vEndTime value is date & time in database i take data type datetime but it gives an error

error: The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.\r\nThe statement has been terminated."

Hi @Yogita_Gaikwad

Give some more detail with screenshot

Check out this thread

Regards
Gokul

i have excel which has column StartTime which contains date & time i want to push this in database for this in multiple assign i create vStartTime variable and insert in database but it gives error :: The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.\r\nThe statement has been terminated

You need to format the insert query so that they’re inserted as Date & time not string (varchar). Update the insert query and check it @Yogita_Gaikwad

is there any need to change Row.item(4).ToString for conversion

Hi @Yogita_Gaikwad

Before doing CDate the value for Row.item(4).ToString should be presented. Need to update the inaert query first and run the process

Try with CDate

CDate(Row.item(4).ToString).Tostring("dd/MM/yyyy")

Regards
Gokul

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.