?
Solved

Populate a drpdown with Current/ PreviousFinacial  Years

Posted on 2009-05-06
2
Medium Priority
?
198 Views
Last Modified: 2012-05-06
Hi all,

I have to populate a dropdownlist based on a query.
Our company  have a financial year from Oct 2008- Sept 2009, next is Oct 2009 -Sept 2010.

In this query  "Select Distinct Year(ForecastDate) from OrderForecast order by Year(ForecastDate)"

I get 2008 and 2009. in this query i basically get the ,  the records that exist for a year , and i get the year from when the records were started inputting into  the database.

Now i need to populate drpdownlist with values like 2008-2009, for the users to select from.
Coming next financial year in Oct, there will be another set of values to be shown that is 2009-2010. This has to be automatically set in dropdown

I hope i have made myself clear.I tried my best to explain my problem.
Thanks for looking and help



0
Comment
Question by:SaraDob
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 12

Accepted Solution

by:
wht1986 earned 1000 total points
ID: 24321436
well you could do it in code or here is a sql statement you can use instead and bind to your dropdown

Select distinct convert(varchar, Year(ForecastDate)) + '-' + convert(varchar,YEAR(dateadd(year,1,ForecastDate))) as ForecastYear from OrderForecast order by ForecastYear
0
 
LVL 1

Author Comment

by:SaraDob
ID: 24325393
wht1986,
Thanks for your reply and perfect answer.


0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question