I have a query that returns all of the publication dates of stories in a
database.  Currently, it returns 18,000 rows.  Eventually, there will be
100,000 stories in the database.  Returning a query with that many records
and manipulating the dates (what I was thinking of doing) seems incrediblly
inefficient.

I would like to extract in a query the following information ...

first year of published stories
        first month of that first year
                first day of that first month of that first year

last year of published stories
        last month of that last year
                last day of that last month of that last year

I tried doing something like

SELECT Max(year(pub_date) as last_year
FROM table

That didn't give me the results I expected.

This is in MS SQL and I'm running the query as a stored procedure.

Suggestions?

Also, any good Web sites for programming transact-SQL?  Especially something
that, given my present need, will cover date manipulation.  I've searched
and haven't been able to find.

H.



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Owens
Internet Operations Coordinator
InsideVC.com/Ventura County Star
[EMAIL PROTECTED]
AIM: GoCatGo1956
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to