scott100 Posted April 8, 2006 Share Posted April 8, 2006 I am trying to display a select with the years shown as options20062007200820092010I just can't get it to add a year on each time i go round the loop, i tried now()+theyear but it wouldn't work.I'm sure it's easy enough but i've been stuck on it a while :)thanks. theyear=1response.write " Year: <select name='year'>" do while (theyear<=6) response.write "<option>" & datepart("yyyy", now()) & "</option>" theyear=theyear+1 loop response.write "</select>" Link to comment Share on other sites More sharing options...
scott100 Posted April 8, 2006 Author Share Posted April 8, 2006 It's ok i found it I put the current date into a dim and then added to that dim newyeartheyear=0response.write " Year: <select name='year'>" do while (theyear<=5) newyear=datepart("yyyy", now()) newyear=newyear+theyearresponse.write "<option>" & newyear & "</option>"theyear=theyear+1 loop response.write "</select>" If there's a better solution then im all ears Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now