Date Column in Excel displaying as number when using Concatenate Function – Isssue

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

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>