"news" wrote in message news:Or**************@TK2MSFTNGP12.phx.gbl...
: Can someone help me with this request?
: 1. Data in my access database have the format "9/10 2005"
: 2. When I show all dates within an asp page I get the following format
: "9/10/2005"
:
: The format I want to show in my asp page is the following format "9/10-05"
Two ways: assuming rs = recordset, mydate = db column name
1.
dim arrDate
if not (rs.BOF or rs.EOF) then
arrDate = split(rs("mydate"),"/")
rs.Close
set rs = nothing
conn.Close
set conn = nothing
Response.Write arrDate(0) & "/" & arrDate(1) & "-" & right(arrDate(2),2)
else
Response.Write "No records returned."
end if
2.
dim d
if not(rs.BOF or rs.EOF) then
d = CDate(rs("mydate"))
rs.Close
set rs = nothing
conn.Close
set conn = nothing
Response.Write month(d) & "/" & day(d) & "-" & right(year(d),2)
else
Response.Write "No records returned."
end if
--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center -
http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation -
http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library -
http://msdn.microsoft.com/library/default.asp