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

using current year in querystring 1

Status
Not open for further replies.

kiwieur

Technical User
Apr 25, 2006
200
GB
Hi,

I have this query string at the moment
Code:
<a class="nav" href="OTIF_YearCharts.asp?aYear=2015" target="cpOTIF_Main" >Charta OTIF 2015</a>
I would like to change it so that it would use the current year so that I do not have to change it at the start of each year. I have tried
Code:
<a class="nav" href="OTIF_YearCharts.asp?aYear=Year()" target="cpOTIF_Main" >Charta OTIF 2014</a>
But that does not work

Does anyone have any ideas please


Regards

Paul

 
try:

Year(Date)

Code:
<a class="nav" href="OTIF_YearCharts.asp?aYear=Year(Date)" target="cpOTIF_Main" >Charta OTIF 2014</a>

-George
Microsoft SQL Server MVP
My Blogs
SQLCop
twitter
"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
gmmastros thanks for the speedy reply, tried your code but get this error

Code:
ADODB.Command error '800a0d5d' 

Application uses a value of the wrong type for the current operation. 

/ChartaPad/OTIF/OTIF_YearCharts.asp, line 20

Regards

Paul

 
try this.

Code:
<a class="nav" href="OTIF_YearCharts.asp?aYear=" & Year(Date) & " target="cpOTIF_Main" >Charta OTIF 2014</a>

-George
Microsoft SQL Server MVP
My Blogs
SQLCop
twitter
"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
you should use

Code:
<a class="nav" href="OTIF_YearCharts.asp?aYear=<% =Year(Date)%>" target="cpOTIF_Main" >Charta OTIF 2014</a>
 
gk53,
Thanks for the info, it worked a treat. A star for you

gmmastros, thanks for your input also

Regards

Paul

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top