Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Old Forums
 CLOSED - General SQL Server
 Last Day of the Month

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-08-11 : 07:06:51
Krishna Mohan writes "Pls send me SQL query, Last day of the month

Thanks"

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2003-08-11 : 07:10:38
The last day of the month is always the day before the first day of the next month...

Jay White
{0}
Go to Top of Page

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2003-08-11 : 07:16:28
Even in a leap year ?


Damian
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2003-08-11 : 07:18:18
SELECT DateAdd(day, -1, DateAdd(month, DateDiff(month, 0, dateValue)+1, 0))
Go to Top of Page

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2003-08-11 : 07:30:36
Rob's idea is ok.

I'd also try writing a dts package to cursor through the rows of an excel spreadsheet that contains every date ... I'll run some tests to figure out which is faster.

Jay White
{0}
Go to Top of Page

Arnold Fribble
Yak-finder General

1961 Posts

Posted - 2003-08-11 : 08:52:43
You ok there Jay?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2003-08-11 : 12:53:38
You guys are too funny!

Tara
Go to Top of Page

Amethystium
Aged Yak Warrior

701 Posts

Posted - 2003-08-11 : 13:20:22
I think he is practicing his urine extraction technique.

Sorry for the scientific description but I'm trying to be as polite as possible.

------------------------------------------------------------------------------
I enjoy using SQL Server but I am not part of the Microsoft fanboy club! NEVER!!
Go to Top of Page
   

- Advertisement -