【问题标题】:Concatenating Date and String in excel [duplicate]在excel中连接日期和字符串[重复]
【发布时间】:2013-03-21 10:02:26
【问题描述】:

在 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 列包含日期时间信息(例如 2013 年 1 月 14 日下午 12:20:01),但是当我应用公式时,它会添加一些其他数值。谁能帮助我,有什么变化用上面的公式吗?

【问题讨论】:

  • 您是在使用 Excel 公式构建 SQL 语句,对吧?
  • 是的,实际上我必须在表中插入 1000 条记录,并且每条记录中只有日期时间发生变化

标签: excel excel-formula excel-2003 formulas


【解决方案1】:

在您的情况下,Excel 在引用的单元格中返回日期的序列号。为确保它返回一个以您想要的格式显示日期的字符串,请使用=TEXT(cell, FormatString)
例如:TEXT(C2, "dd/mmm/yy")
好机会

【讨论】:

    猜你喜欢
    • 2012-01-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-12-16
    • 2015-02-14
    • 2013-11-30
    • 1970-01-01
    • 2019-10-24
    相关资源
    最近更新 更多