Date: Thu, 12 Jun 2003 13:55:33 +0900
From: "前田 肇" <who@example.co.jp>
This is a multi-part message in MIME format.
------=_NextPart_000_0005_01C330EA.4AB96390
Content-Type: text/plain;
charset="iso-2022-jp"
Content-Transfer-Encoding: 7bit
前田と申します。
Dim conv_date1 As Integer
Dim conv_date2 As Integer
Dim conv_date3 As Integer
Dim conv_date As String
conv_date1 = Year(DateAdd("Y", 0, Date))
conv_date2 = Month(DateAdd("M", 0, Date))
conv_date3 = Day(DateAdd("D", 0, Date))
'conv_date = Mid(conv_date1, 1, 4) + "/" + Mid(conv_date2, 1, 2) + "/" +
Mid(conv_date3, 1, 2)
conv_date = Format(conv_date1, "0000") & "/" & Format(conv_date2, "00") &
"/" & Format(conv_date3, "00")
これでいかがでしょうか?
ヘルプの件は、
分かりません。
お世話になります。
SQLServer7.0のDTSパッケージのデザイナーに「データ変換のプロパティ」でテー
ブル間で「列マッピングを定義」するのにActiveXスクリプトで「VB Script」を使っ
ております。
次の2点について教えて下さい。
○DATE関数を使って今日の日付を文字型で表示したいのですが、わかりません。
例えば、'2003/06/12' というふうに。('2003/6/12'ではありません)
以下のVBScriptで '2003/6/11' (数字型)が表示されますが、'2003/06/11'(文字
型)の表示方法を教えて下さい。
Function Main()
conv_date1 = year(DateAdd("Y" , 0 , date ))
conv_date2 = month(DateAdd("M" , 0 , date ))
conv_date3 = day(DateAdd("D" , 0 , date ))
conv_date = mid(conv_date1,1,4) + "/" + mid(conv_date2,1,2) + "/" +
mid(conv_date3,1,2)
DTSDestination("更新日") = Cstr(conv_date)
End Function
(更新日 char10桁です)
------=_NextPart_000_0005_01C330EA.4AB96390
Content-Type: text/html;
charset="iso-2022-jp"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-2022-jp">
<META content=3D"MSHTML 6.00.2800.1170" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3D"MS UI Gothic" =
size=3D2>=1B$BA0ED$H?=3D$7$^$9!#=1B(B</FONT></DIV>
<DIV><FONT face=3D"MS UI Gothic" size=3D2></FONT> </DIV>
<DIV><FONT face=3D"MS UI Gothic" size=3D2>Dim conv_date1 As =
Integer<BR>Dim=20
conv_date2 As Integer<BR>Dim conv_date3 As Integer<BR>Dim conv_date As=20
String</FONT></DIV>
<DIV><FONT face=3D"MS UI Gothic" size=3D2></FONT> </DIV>
<DIV><FONT face=3D"MS UI Gothic" size=3D2>conv_date1 =3D =
Year(DateAdd("Y", 0,=20
Date))<BR>conv_date2 =3D Month(DateAdd("M", 0, Date))<BR>conv_date3 =3D=20
Day(DateAdd("D", 0, Date))<BR>'conv_date =3D Mid(conv_date1, 1, 4) + "/" =
+=20
Mid(conv_date2, 1, 2) + "/" + Mid(conv_date3, 1, 2)<BR>conv_date =3D=20
Format(conv_date1, "0000") & "/" & Format(conv_date2, "00") =
& "/"=20
& Format(conv_date3, "00")</FONT></DIV>
<DIV><FONT face=3D"MS UI Gothic" size=3D2></FONT> </DIV>
<DIV><FONT face=3D"MS UI Gothic" =
size=3D2>=1B$B$3$l$G$$$+$,$G$7$g$&$+!)=1B(B</FONT></DIV>
<DIV><FONT face=3D"MS UI Gothic" =
size=3D2>=1B$B%X%k%W$N7o$O!"=1B(B</FONT></DIV>
<DIV><FONT face=3D"MS UI Gothic" =
size=3D2>=1B$BJ,$+$j$^$;$s!#=1B(B</FONT></DIV>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV><FONT face=3D"=1B$B#M#S=1B(B =
=1B$B#P%4%7%C%/=1B(B">=1B$B$*@$OC$K$J$j$^$9!#=1B(B</FONT><BR><FONT=20
face=3D"=1B$B#M#S=1B(B =
=1B$B#P%4%7%C%/=1B(B">SQLServer7.0=1B$B$N=1B(BDTS=1B$B%Q%C%1!<%8$N%G%6%$%=
J!<$K!V%G!<%?JQ49$N%W%m%Q%F%#!W$G%F!<%V%k4V$G!VNs%^%C%T%s%0$rDj5A!W$9$k$N=
$K=1B(BActiveX=1B$B%9%/%j%W%H$G!V=1B(BVB=20
Script=1B$B!W$r;H$C$F$*$j$^$9!#=1B(B</FONT><BR><FONT=20
face=3D"=1B$B#M#S=1B(B =
=1B$B#P%4%7%C%/=1B(B">=1B$B<!$N=1B(B2=1B$BE@$K$D$$$F65$($F2<$5$$!#=1B(B</=
FONT><BR><BR><FONT=20
face=3D"=1B$B#M#S=1B(B =
=1B$B#P%4%7%C%/=1B(B">=1B$B!{=1B(BDATE=1B$B4X?t$r;H$C$F:#F|$NF|IU$rJ8;z7?=
$GI=3D<($7$?$$$N$G$9$,!"$o$+$j$^$;$s!#=1B(B</FONT><BR><FONT=20
face=3D"=1B$B#M#S=1B(B =
=1B$B#P%4%7%C%/=1B(B">=1B$BNc$($P!"=1B(B'2003/06/12' =
=1B$B$H$$$&$U$&$K!#=1B(B('2003/6/12'=1B$B$G$O$"$j$^$;$s=1B(B)</FONT><BR><=
FONT=20
face=3D"=1B$B#M#S=1B(B =
=1B$B#P%4%7%C%/=1B(B">=1B$B0J2<$N=1B(BVBScript=1B$B$G=1B(B '2003/6/11'=20
=
(=1B$B?t;z7?!K$,I=3D<($5$l$^$9$,!"=1B(B'2003/06/11'=1B$B!JJ8;z7?!K$NI=3D<=
(J}K!$r65$($F2<$5$$!#=1B(B</FONT><BR><FONT=20
face=3D"=1B$B#M#S=1B(B =1B$B#P%4%7%C%/=1B(B">Function =
Main()<BR>conv_date1 =3D year(DateAdd("Y" , 0 , date ))=20
<BR>conv_date2 =3D month(DateAdd("M" , 0 , date )) <BR>conv_date3 =3D=20
day(DateAdd("D" , 0 , date )) <BR>conv_date =3D mid(conv_date1,1,4) + =
"/" +=20
mid(conv_date2,1,2) + "/" + =
mid(conv_date3,1,2)<BR>DTSDestination("=1B$B99?7F|=1B(B") =3D=20
Cstr(conv_date) </FONT><BR><FONT face=3D"=1B$B#M#S=1B(B =
=1B$B#P%4%7%C%/=1B(B">End Function </FONT><BR><FONT=20
face=3D"=1B$B#M#S=1B(B =1B$B#P%4%7%C%/=1B(B">=1B$B!J99?7F|=1B(B =
char10=1B$B7e$G$9!K=1B(B</FONT></DIV>
<DIV> </DIV></BLOCKQUOTE></BODY></HTML>
------=_NextPart_000_0005_01C330EA.4AB96390--
[MSDE/SQLServerに関して、今、どんなことにお困りですか?] |
よろしければお困りの内容を、電子メールで教えて下さい。 |
質問を電子メールで作成する
|
[ウィンドを閉じる][MSDE/SQLServer FAQ ][MSDE / MSDE2000 技術サポート情報一覧]
|