搜索
查看: 1351|回复: 0

数据转换公式,请高手帮修改日期输出格式,谢谢

[复制链接]
发表于 2010-10-2 10:58 | 显示全部楼层

数据转换公式,请高手帮修改日期输出格式,谢谢

来自:MACD论坛(bbs.shudaoyoufang.com) 作者:tyfvip 浏览:1351 回复:0

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
数据转换公式,请高手帮把输出日期格式改成8位,谢谢



以下公式输出日期格式为:4/1/2010

请高手帮把输出格式改为:04/01/2010

万分感谢









a3:o;a4:=h;a5:=l;a6:=c;a7:=v;
a11:=year; a12:=month; a13:=day;a14:=time;

nDM:=STKLABEL;
<%
b3=FFL.VARDATA("a3")
b4=FFL.VARDATA("a4")
b5=FFL.VARDATA("a5")
b6=FFL.VARDATA("a6")
b7=FFL.VARDATA("a7")
b11=FFL.VARDATA("a11")
b12=FFL.VARDATA("a12")
b13=FFL.VARDATA("a13")
b14=FFL.VARDATA("a14")

vn=FFL.VARDATA("n")
VDM=FFL.VARDATA("nDM")
u=ubound(b3)
dim d(6000,7)
if b14(u)>0 then
for i=u to 1 step -1
b13(i-1)=b13(i)-1
if b13(i-1)=0 then b13(i-1)=30 end if
next
for i=u to 1 step -1
b12(i-1)=b12(i)
if b13(i-1)=30 then b12(i-1)=b12(i)-1 end if
if b12(i-1)=0 then b12(i-1)=12 end if
next
for i=u to 1 step -1
b11(i-1)=b11(i)
if b12(i-1)=12 and b13(i-1)=30 then b11(i-1)=b11(i)-1 end if
next
end if

for i=0 to u
d(i,1)=cstr(b12(i))+"/"+cstr(b13(i))+"/"+cstr(b11(i))
d(i,2)="000000"
r=int(b3(i))
r1=round((b3(i)-r)*10000)
if r1<10 then r2="000" & cstr(r1) end if
if r1>=10 and r1<100 then r2="00" & cstr(r1) end if
if r1>=100 and r1<1000 then r2="0" & cstr(r1) end if
if r1>=1000 then r2= cstr(r1) end if
if r1>=9999 then r=r+1: r2="0000" end if
d(i,3)=cstr(r) &"."& cstr(r2)
r=int(b4(i))
r1=round((b4(i)-r)*10000)
if r1<10 then r2="000" & cstr(r1) end if
if r1>=10 and r1<100 then r2="00" & cstr(r1) end if
if r1>=100 and r1<1000 then r2="0" & cstr(r1) end if
if r1>=1000 then r2= cstr(r1) end if
if r1>=9999 then r=r+1: r2="0000" end if
d(i,4)=cstr(r) &"."& cstr(r2)
r=int(b5(i))
r1=round(round((b5(i)-r)*10000)*10000)/10000

if r1<10 then r2="000" & cstr(r1) end if

if r1>=10 and r1<100 then r2="00" & cstr(r1) end if
if r1>=100 and r1<1000 then r2="0" & cstr(r1) end if
if r1>=1000 then r2= cstr(r1) end if
if r1>=9999 then r=r+1: r2="0000" end if

d(i,5)=cstr(r) &"."& cstr(r2)
r=int(b6(i))
r1=round((b6(i)-r)*10000)
if r1<10 then r2="000" & cstr(r1) end if
if r1>=10 and r1<100 then r2="00" & cstr(r1) end if
if r1>=100 and r1<1000 then r2="0" & cstr(r1) end if
if r1>=1000 then r2= cstr(r1) end if
if r1>=9999 then r=r+1: r2="0000" end if
d(i,6)=cstr(r) &"."& cstr(r2)
d(i,7)=cstr(round(b7(i)))
next

if vn=0 then n0=0 end if
if vn>0 then n0=u-vn end if
if n0<0 then n0=0 end if
Dim fso, txtf
FileName="D:\wt\A" & cstr(vdm) & ".txt"
Set fso = CreateObject("Scripting.FileSystemObject")
Set txtf=fso.createtextfile(filename,true)
for i=n0 to u
tr = d(i,1) & "," & d(i,3) & "," & d(i,4) &","& d(i,5) & ","& d(i,6) & "," & d(i,7)
txtf.WriteLine(tr)
next
txtf.Close
%>

[ 本帖最后由 tyfvip 于 2010-10-2 20:54 编辑 ]
金币:
奖励:
热心:
注册时间:
2010-6-2

回复 使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

本站声明:MACD仅提供交流平台,请交流人员遵守法律法规。
值班电话:18209240771   微信:35550268

举报|意见反馈|手机版|MACD俱乐部

GMT+8, 2025-4-30 21:14 , Processed in 0.027332 second(s), 11 queries , MemCached On.

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表