0

我正在使用 CONCATENATE 函数对单元格中的数据进行分组,我必须在其中包含日期和时间戳。我需要在我的数据库中运行一些批次的数据作为我日常工作的一部分。我最重要的是需要日期和时间戳,因为这将有助于最大限度地减少我的工作量。

数据单元 A3:2012-07-31 18:00:00 单元 B3:(521976、521977、521978、521979) 公式:=CONCATENATE("update tbl_content_master set start_date='",A3,"' where content_id in ",B3 ,";") 结果:更新 tbl_content_master set start_date='41121.75' where content_id in (521976, 521977, 521978, 521979);

ISSUE FROM FORMULA start_date='",A3,"' ie 2012-07-31 18:00:00 (date with time stamp) FROM RESULT start_date='41121.75' ie 41121.75 (decimal format)

目前结果:更新 tbl_content_master 设置 start_date='41121.75' 其中 content_id 在(521976、521977、521978、521979);

要求的结果:更新 tbl_content_master 设置 start_date='2012-07-31 18:00:00' 其中 content_id 在(521976、521977、521978、521979);

4

1 回答 1

0

使用 TEXT 函数:TEXT( cell w/date , " format string ")

=CONCATENATE("update tbl_content_master set start_date='",TEXT(A3,"YYYY-mm-dd hh:mm:ss"),"' where content_id in ",B3,";")
于 2012-08-05T19:34:14.523 回答