[dba-SQLServer]SQL Last Full Month

Nicholson, Karen knicholson at gpsx.net
Wed Sep 24 10:09:31 CDT 2003


All in SQL.  I just figured out how to get the first day of the year:
 
select DATEADD(yy, DATEDIFF(yy,0,getdate()), 0) /* first day of year*/
 
So now I am on to trying to figure out how to get the first day of the prior
month and the last day of the prior month.

-----Original Message-----
From: paul.hartland at fsmail.net [mailto:paul.hartland at fsmail.net]
Sent: Wednesday, September 24, 2003 10:02 AM
To: dba-sqlserver at databaseadvisors.com
Subject: Re: [dba-SQLServer]SQL Last Full Month


are you doing this entirely in SQL Server or using Access or VB as a
front-end ?





Message date : Sep 24 2003, 02:44 PM 
>From : Nicholson, Karen 
To : Dba-Sqlserver (E-mail) 
Copy to : 
Subject : [dba-SQLServer]SQL Last Full Month 
Does anyone have a quick Last Full Month solution in SQL? I need to run 
reports for the prior month, and have about 25 lines of code to get to the 
last full month. Thanks in advance. 
_______________________________________________ 
dba-SQLServer mailing list 
dba-SQLServer at databaseadvisors.com 
http://databaseadvisors.com/mailman/listinfo/dba-sqlserver 
http://www.databaseadvisors.com 



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://databaseadvisors.com/pipermail/dba-sqlserver/attachments/20030924/62f8e629/attachment.html>


More information about the dba-SQLServer mailing list