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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Year Date Format

Status
Not open for further replies.

Silvinho

Programmer
Jul 9, 2001
58
GB
Is it possible to display only the year of a date in asp

ie: the database stores the record '21/08/2002', i just want the asp page to show '2002'
 
try this:

<%
Dim iYear
iYear = DatePart(&quot;yyyy&quot;, objRS(&quot;myDate&quot;))
Response.write iYear

%>

Hope it helps
 
Try this,

Code:
<%=year(recordset(&quot;datefield&quot;))%>

if you need something else or are getting errors give more detail and copy of the error.

Hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top