3

I have a question about concatenating a Date column (datetime) type in Excel 2010. For some reason, when concatenating Date, the values show as numbers. Below is my attempt to concatenate it.

Given two columns in Excel 2010

Date                        ID
2/22/2010 12:00:00 AM       1
6/27/2001 12:41:30 PM       2
3/11/2004  9:00:00 AM       3

Here, I am using the CONCATENATE function to concatenate two columns into a #temp table but the values in Date show as below

INSERT INTO #temp VALUES ('40231','1')
INSERT INTO #temp VALUES ('37069.5288194444','2')
INSERT INTO #temp VALUES ('38057.375','3')

Is there a way in Excel 2010 that I can use to concatenate exactly what I wanted which is like column Date above?

4

1 回答 1

9

尝试使用 TEXT 函数根据需要设置日期格式,例如

="Some text "&TEXT(A2,"m/d/yyyy")

其中 A2 包含日期

根据需要更改“m/d/yyyy”部分,例如,如果您也想要时间:

="Some text "&TEXT(A2,"m/d/yyyy hh:mm AM/PM")

于 2013-09-17T12:44:52.663 回答