First as I understand it, if my return values on my custom sproc are ordered right, it should return my object?
here is my sql code for the sproc I am trying to write.
SELECT City, State, ZipCode, AreaCode, TimeZone, MAX(CacheTime) AS CacheTime
FROM dbo.USZipCache
GROUP BY City, State, ZipCode, AreaCode, TimeZone
However it is returning a dataset.
here is the table def.
CREATE
TABLE [dbo].[USZipCache](
[City] [varchar]
(50) COLLATE Latin1_General_CI_AI NULL,
[State] [varchar]
(2) COLLATE Latin1_General_CI_AI NULL,
[ZipCode] [varchar]
(10) COLLATE Latin1_General_CI_AI NOT NULL,
[AreaCode] [varchar]
(5) COLLATE Latin1_General_CI_AI NULL,
[TimeZone] [char]
(1) COLLATE Latin1_General_CI_AI NULL,
[CacheTime] [smalldatetime]
NOT NULL,
CONSTRAINT [PK_USZipCache] PRIMARY KEY CLUSTERED
(
[ZipCode]
ASC
)
WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
)
ON [PRIMARY]
GO
I am thinking either the MAX is messing things up, or the group by...but it all boils down to the same thing.
thanks