在Excel中连接date和string

在这里输入图像说明

在Excel中,我使用以下公式:

="Select Count(1) Into Count1 From TRB_TPOAR Where tpo_id='" & A2 & "' and eta_id=old_eta_id and date_creation=to_date('" & B2 & "','dd/mm/yyyy HH24:MI:SS') and UTL1_EDS_ID='DEI037'; if Count1>0 then Update TRB_TPOAR Set Eta_id=new_eta_id Where tpo_id='" & A2 & "' and eta_id=old_eta_id and date_creation=to_date('" & B2 & "','dd/mm/yyyy HH24:MI:SS') and UTL1_EDS_ID='DEI037'; DBMS_OUTPUT.PUT_LINE('" & A2 & "' UPDATED'); end if;" 

在Excel表中,列B包含date时间信息(例如2013年1月14日12:20:01 PM),但是当我应用公式时,它会添加一些其他的数值。可以帮助我的人,上面有什么变化式?

在你的情况下,Excel将返回引用单元格中date的serila数字。 要确保它返回一个string,以所需的格式显示date,请使用=TEXT(cell, FormatString)
例如: TEXT(C2, "dd/mmm/yy")
Bonne的机会