It is very common to use CONCATENATE function in excel to generate the SQL statements for small set of data to be loaded from excel files. But when date fields are involved, the concatenate function fails unless the date column is converted to TEXT first.
sample :
if A1 has date and B1 has a integer number, below ways shows excel serial number
A1: 01/01/2000
B1: 1
=Concatenate(“select ‘”, A1, “‘,'”, B1, “‘”)
output:select ‘36526’,’1′ –> Incorrect
=CONCATENATE(“select ‘”, TEXT(J5, “YYYY-MM-DD”), “‘,'”, K5, “‘”)
output:select ‘2000-01-01′,’1’ –> Correct

0 Comments.