Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Quich and easy....4u

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
The following problem is my problemQ
the name of file is :
JD_02_20020513.doc and i want to seperate in three variables
a=jd
b=02
c=20020513. Then "c" because is date time i want to break it again in
x=2002
y=05
z=13
.....Can anyone help me?
thanks in advance.
 
JD_02_20020513.doc and i want to seperate in three variables
a=jd
b=02
c=20020513. Then "c" because is date time i want to break it again in
x=2002
y=05
z=13

<% filename =&quot;JD_02_20020513.doc&quot;

parts = split(filename,&quot;_&quot;)

if ubound(parts) <> 2 then
response.write &quot;Filename does not contain all parts&quot;
response.end
end if

a = parts(0)
b = parts(1)
c = parts(2)

'now get rid of the extension on c
c = left(c, len(c) - instr(c, &quot;.&quot;)-1)
' in the above statement
' len(c) is the length of c
' the instr() finds where the extension begins (.)

'now split up the date
x = left(c, 4) 'first four chars

y = mid(c, 5, 2) 'start at 5, length of 2 chars

z = left(c, 2) 'last 2 chars

%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top