|
 |
asp_web_howto thread: Change string
Message #1 by "Matthew Lohr" <mlohr@t...> on Fri, 30 Mar 2001 08:51:10 -0500
|
|
I have a string that I know has a space in it. For one value that I display
I need to display everything tho the left of the space only. After playing
with this for 2 days I have come up with the following which still doesn't
work
dim dte
dim i
Dim quick
Dim quick2
for i = 1 to len(thefile.datelastmodified)
if char((thefile.datelastmodified),i) <> " " then
dte = dte & char((thefile.datelastmodified),i)
End If
next
Is there a way to tkae just the date and not the time for .datelastmodified.
Looking at microsoft.com i have not found it. Other wise I know if I take
the last 11 characters off of the right side it would also work
Message #2 by Shaun Steckley <SSTECKLEY@P...> on Fri, 30 Mar 2001 09:09:58 -0500
|
|
why don't you use the split() function on the space...
-----Original Message-----
From: Matthew Lohr [mailto:mlohr@t...]
Sent: Friday, March 30, 2001 8:51 AM
To: ASP Web HowTo
Subject: [asp_web_howto] Change string
I have a string that I know has a space in it. For one value that I display
I need to display everything tho the left of the space only. After playing
with this for 2 days I have come up with the following which still doesn't
work
dim dte
dim i
Dim quick
Dim quick2
for i = 1 to len(thefile.datelastmodified)
if char((thefile.datelastmodified),i) <> " " then
dte = dte & char((thefile.datelastmodified),i)
End If
next
Is there a way to tkae just the date and not the time for .datelastmodified.
Looking at microsoft.com i have not found it. Other wise I know if I take
the last 11 characters off of the right side it would also work
Message #3 by "Alex Shiell, ITS, EC, SE" <alex.shiell@s...> on Fri, 30 Mar 2001 15:39:27 +0100
|
|
if you just want the date part, do this
dte = Date(thefile.datelastmodified)
alternative methods for what you were trying to do are:
set a = split(thefile.datelastmodified, " ")
dte = a(0)
and
dte = thefile.datelastmodified
set i = instr(dte , " ")
dte = left(dte, i)
-----Original Message-----
From: Matthew Lohr [mailto:mlohr@t...]
Sent: Friday, March 30, 2001 2:51 PM
To: ASP Web HowTo
Subject: [asp_web_howto] Change string
I have a string that I know has a space in it. For one value that I display
I need to display everything tho the left of the space only. After playing
with this for 2 days I have come up with the following which still doesn't
work
dim dte
dim i
Dim quick
Dim quick2
for i = 1 to len(thefile.datelastmodified)
if char((thefile.datelastmodified),i) <> " " then
dte = dte & char((thefile.datelastmodified),i)
End If
next
Is there a way to tkae just the date and not the time for .datelastmodified.
Looking at microsoft.com i have not found it. Other wise I know if I take
the last 11 characters off of the right side it would also work
________________________________________________________________________
Scottish Enterprise Network
http://www.scottish-enterprise.com
Message #4 by "Peter Lanoie" <planoie@e...> on Fri, 30 Mar 2001 10:02:22 -0500
|
|
dtmJustDate = CDate(thefile.datelastmodified)
-----Original Message-----
From: Matthew Lohr [mailto:mlohr@t...]
Sent: Friday, March 30, 2001 8:51 AM
To: ASP Web HowTo
Subject: [asp_web_howto] Change string
I have a string that I know has a space in it. For one value that I display
I need to display everything tho the left of the space only. After playing
with this for 2 days I have come up with the following which still doesn't
work
dim dte
dim i
Dim quick
Dim quick2
for i = 1 to len(thefile.datelastmodified)
if char((thefile.datelastmodified),i) <> " " then
dte = dte & char((thefile.datelastmodified),i)
End If
next
Is there a way to tkae just the date and not the time for .datelastmodified.
Looking at microsoft.com i have not found it. Other wise I know if I take
the last 11 characters off of the right side it would also work
Message #5 by "Alex Shiell, ITS, EC, SE" <alex.shiell@s...> on Fri, 30 Mar 2001 16:33:02 +0100
|
|
just noticed my mistake
set i = instr(dte, " ")
should be
i = instr(dte, " ")
-----Original Message-----
From: Alex Shiell, ITS, EC, SE [mailto:alex.shiell@s...]
Sent: Friday, March 30, 2001 3:39 PM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: Change string
if you just want the date part, do this
dte = Date(thefile.datelastmodified)
alternative methods for what you were trying to do are:
set a = split(thefile.datelastmodified, " ")
dte = a(0)
and
dte = thefile.datelastmodified
set i = instr(dte , " ")
dte = left(dte, i)
-----Original Message-----
From: Matthew Lohr [mailto:mlohr@t...]
Sent: Friday, March 30, 2001 2:51 PM
To: ASP Web HowTo
Subject: [asp_web_howto] Change string
I have a string that I know has a space in it. For one value that I display
I need to display everything tho the left of the space only. After playing
with this for 2 days I have come up with the following which still doesn't
work
dim dte
dim i
Dim quick
Dim quick2
for i = 1 to len(thefile.datelastmodified)
if char((thefile.datelastmodified),i) <> " " then
dte = dte & char((thefile.datelastmodified),i)
End If
next
Is there a way to tkae just the date and not the time for .datelastmodified.
Looking at microsoft.com i have not found it. Other wise I know if I take
the last 11 characters off of the right side it would also work
________________________________________________________________________
Scottish Enterprise Network
http://www.scottish-enterprise.com
Message #6 by "Matthew Lohr" <mlohr@t...> on Fri, 30 Mar 2001 10:47:00 -0500
|
|
Ok i must be doing something wrong or I am lost or something. Non of the
examples seem to work for me.
dtmJustDate = CDate(thefile.datelastmodified)
gives me the date and time
dte = Date(thefile.datelastmodified)
gives me
Microsoft VBScript runtime error '800a01c2'
Wrong number of arguments or invalid property assignment: 'date'
/admin/reports/temp.asp, line 153
alternative methods for what you were trying to do are:
set a = split(thefile.datelastmodified, " ")
dte = a(0)
gives me
Microsoft VBScript runtime error '800a01a8'
Object required
/admin/reports/temp.asp, line 153
and
dte = thefile.datelastmodified
set i = instr(dte , " ")
dte = left(dte, i)
gives me
Microsoft VBScript runtime error '800a01a8'
Object required: '[number: 0]'
/admin/reports/temp.asp, line 153
-----Original Message-----
From: Peter Lanoie [mailto:planoie@e...]
Sent: Friday, March 30, 2001 10:02 AM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: Change string
dtmJustDate = CDate(thefile.datelastmodified)
-----Original Message-----
From: Matthew Lohr [mailto:mlohr@t...]
Sent: Friday, March 30, 2001 8:51 AM
To: ASP Web HowTo
Subject: [asp_web_howto] Change string
I have a string that I know has a space in it. For one value that I display
I need to display everything tho the left of the space only. After playing
with this for 2 days I have come up with the following which still doesn't
work
dim dte
dim i
Dim quick
Dim quick2
for i = 1 to len(thefile.datelastmodified)
if char((thefile.datelastmodified),i) <> " " then
dte = dte & char((thefile.datelastmodified),i)
End If
next
Is there a way to tkae just the date and not the time for .datelastmodified.
Looking at microsoft.com i have not found it. Other wise I know if I take
the last 11 characters off of the right side it would also work
Message #7 by "Alex Shiell, ITS, EC, SE" <alex.shiell@s...> on Fri, 30 Mar 2001 17:05:56 +0100
|
|
sorry the date function must expect a date object
try
dte = Date(CDate(thefile.datelastmodified))
as for other examples I gave you, remove the word "set"
-----Original Message-----
From: Matthew Lohr [mailto:mlohr@t...]
Sent: Friday, March 30, 2001 4:47 PM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: Change string
Ok i must be doing something wrong or I am lost or something. Non of the
examples seem to work for me.
dtmJustDate = CDate(thefile.datelastmodified)
gives me the date and time
dte = Date(thefile.datelastmodified)
gives me
Microsoft VBScript runtime error '800a01c2'
Wrong number of arguments or invalid property assignment: 'date'
/admin/reports/temp.asp, line 153
alternative methods for what you were trying to do are:
set a = split(thefile.datelastmodified, " ")
dte = a(0)
gives me
Microsoft VBScript runtime error '800a01a8'
Object required
/admin/reports/temp.asp, line 153
and
dte = thefile.datelastmodified
set i = instr(dte , " ")
dte = left(dte, i)
gives me
Microsoft VBScript runtime error '800a01a8'
Object required: '[number: 0]'
/admin/reports/temp.asp, line 153
-----Original Message-----
From: Peter Lanoie [mailto:planoie@e...]
Sent: Friday, March 30, 2001 10:02 AM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: Change string
dtmJustDate = CDate(thefile.datelastmodified)
-----Original Message-----
From: Matthew Lohr [mailto:mlohr@t...]
Sent: Friday, March 30, 2001 8:51 AM
To: ASP Web HowTo
Subject: [asp_web_howto] Change string
I have a string that I know has a space in it. For one value that I display
I need to display everything tho the left of the space only. After playing
with this for 2 days I have come up with the following which still doesn't
work
dim dte
dim i
Dim quick
Dim quick2
for i = 1 to len(thefile.datelastmodified)
if char((thefile.datelastmodified),i) <> " " then
dte = dte & char((thefile.datelastmodified),i)
End If
next
Is there a way to tkae just the date and not the time for .datelastmodified.
Looking at microsoft.com i have not found it. Other wise I know if I take
the last 11 characters off of the right side it would also work
________________________________________________________________________
Scottish Enterprise Network
http://www.scottish-enterprise.com
Message #8 by "Matthew Lohr" <mlohr@t...> on Fri, 30 Mar 2001 11:32:33 -0500
|
|
the ones where you tell me to remove set work just fine. The other one is
still giving me problems though thanks I got what I need.
-----Original Message-----
From: Alex Shiell, ITS, EC, SE [mailto:alex.shiell@s...]
Sent: Friday, March 30, 2001 11:06 AM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: Change string
sorry the date function must expect a date object
try
dte = Date(CDate(thefile.datelastmodified))
as for other examples I gave you, remove the word "set"
-----Original Message-----
From: Matthew Lohr [mailto:mlohr@t...]
Sent: Friday, March 30, 2001 4:47 PM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: Change string
Ok i must be doing something wrong or I am lost or something. Non of the
examples seem to work for me.
dtmJustDate = CDate(thefile.datelastmodified)
gives me the date and time
dte = Date(thefile.datelastmodified)
gives me
Microsoft VBScript runtime error '800a01c2'
Wrong number of arguments or invalid property assignment: 'date'
/admin/reports/temp.asp, line 153
alternative methods for what you were trying to do are:
set a = split(thefile.datelastmodified, " ")
dte = a(0)
gives me
Microsoft VBScript runtime error '800a01a8'
Object required
/admin/reports/temp.asp, line 153
and
dte = thefile.datelastmodified
set i = instr(dte , " ")
dte = left(dte, i)
gives me
Microsoft VBScript runtime error '800a01a8'
Object required: '[number: 0]'
/admin/reports/temp.asp, line 153
-----Original Message-----
From: Peter Lanoie [mailto:planoie@e...]
Sent: Friday, March 30, 2001 10:02 AM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: Change string
dtmJustDate = CDate(thefile.datelastmodified)
-----Original Message-----
From: Matthew Lohr [mailto:mlohr@t...]
Sent: Friday, March 30, 2001 8:51 AM
To: ASP Web HowTo
Subject: [asp_web_howto] Change string
I have a string that I know has a space in it. For one value that I display
I need to display everything tho the left of the space only. After playing
with this for 2 days I have come up with the following which still doesn't
work
dim dte
dim i
Dim quick
Dim quick2
for i = 1 to len(thefile.datelastmodified)
if char((thefile.datelastmodified),i) <> " " then
dte = dte & char((thefile.datelastmodified),i)
End If
next
Is there a way to tkae just the date and not the time for .datelastmodified.
Looking at microsoft.com i have not found it. Other wise I know if I take
the last 11 characters off of the right side it would also work
________________________________________________________________________
Scottish Enterprise Network
http://www.scottish-enterprise.com
---
SoftArtisans helps developers build robust, scalable Web applications!
Excel Web reports, charts: http://www.softartisans.com/excelwriter.html
File uploads: http://www.softartisans.com/saf.html
Transactional file management: http://www.softartisans.com/saf1.html
Scalability: http://www.softartisans.com/saxsession.html
ASPstudio value pack: http://www.softartisans.com/aspstudiosuite.html
$subst('Email.Unsub')
|
|
 |