Start is now in the statement and builds up through the iterations of
the date math.


SELECT DAY( DATEADD                                        --<< 4.
Extract the last day
            ( DAY, -1,                                     --<< 3. Find
last day of current month
                DATEADD(MONTH,1,                           --<< 2.
Find first day of next month
                        CAST( CAST(                        --<< 1.
Find first day of the current month
                            YEAR(CURRENT_TIMESTAMP) AS VARCHAR(04))
                            + RIGHT( ('0' +
CAST(MONTH(CURRENT_TIMESTAMP) AS VARCHAR(02))) , 2 )
                            + '01' AS DATETIME)
                        )
            )
            )


-- 
Stephen Russell

Unified Health Services
60 Germantown Court
Suite 220
Cordova, TN 38018

Telephone: 888.510.2667

901.246-0159 cell
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to