I have daily data from year 1995 to 2004. The following query
SELECT [obsDate] FROM [tblObs]
returns 3653 datevalue records for each day.
1995-01-01 00:00:00
1995-01-02 00:00:00
1995-01-03 00:00:00
----------------------
----------------------
2004-12-29 00:00:00
2004-12-30 00:00:00
2004-12-31 00:00:00
I just want a recordset having years. That means with only 10 records as
follow.
1995
1996
1997
-----
-----
2004
What should be the SQL query?
I do not know anything about objectDataSource of ADO.NET. Is it worthwhile
or better for this kind of problem?
Thanks for reading this ...
Regds,
Web learner
Try:
select distinct
Year (obsDate) as 'Year'
from
tblObs

Signature
Tom
----------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Toronto, ON Canada
.
I have daily data from year 1995 to 2004. The following query
SELECT [obsDate] FROM [tblObs]
returns 3653 datevalue records for each day.
1995-01-01 00:00:00
1995-01-02 00:00:00
1995-01-03 00:00:00
----------------------
----------------------
2004-12-29 00:00:00
2004-12-30 00:00:00
2004-12-31 00:00:00
I just want a recordset having years. That means with only 10 records as
follow.
1995
1996
1997
-----
-----
2004
What should be the SQL query?
I do not know anything about objectDataSource of ADO.NET. Is it worthwhile
or better for this kind of problem?
Thanks for reading this ...
Regds,
Web learner
Web learner - 05 Apr 2006 02:47 GMT
Yes, it worked. This is what I wanted for the moment.
Thanks......
> Try:
>
[quoted text clipped - 36 lines]
>
> Web learner