hi ASP'ers,
My SQL Server 7 table has hundreds of date values. I want to select just the unique (Distinct) year values. So I should get a recordset containing 3 or so records: 2000, 001, 2002
______________________________________________________
This is the SQL statement I am trying to use in the ASP.
It gives error: Invalid col name YEAR
sql = "SELECT DISTINCT year(DateClosed) FROM LoadHist ORDER BY year"
______________________________________________________
(I thought this would work because I have used
sql = "SELECT Carrier, ItemCount FROM LoadHist WHERE year(DateClosed) = '" & intyr & "' AND month(DateClosed) = '" & intmo & "'" to select just on the year portion of a date and it worked)
As always, Thanks. John
My SQL Server 7 table has hundreds of date values. I want to select just the unique (Distinct) year values. So I should get a recordset containing 3 or so records: 2000, 001, 2002
______________________________________________________
This is the SQL statement I am trying to use in the ASP.
It gives error: Invalid col name YEAR
sql = "SELECT DISTINCT year(DateClosed) FROM LoadHist ORDER BY year"
______________________________________________________
(I thought this would work because I have used
sql = "SELECT Carrier, ItemCount FROM LoadHist WHERE year(DateClosed) = '" & intyr & "' AND month(DateClosed) = '" & intmo & "'" to select just on the year portion of a date and it worked)
As always, Thanks. John