TSQL End of Current Month
July 8th, 2010select dateadd(m, datediff(m, 0, dateadd(m, 1, getdate())), -1)
Proin accumsan urna in mi. Aenean elementum egestas tortor. Donec neque magna, auctor a, dapibus sit amet, facilisis sit amet, ligula..
select dateadd(m, datediff(m, 0, dateadd(m, 1, getdate())), -1)
Running totals are one of those things that are used a lot in reporting, and custom running totals end up being used more than not. In this post we will have a quick code to show row numbers by custom increments, so hidden rows and groups etc, will not effect this. I Modified my standard Running Total code to simplify this when rownumber() was failing for me.
Step 1 : report code
public dim RunningTotal as int32 = 1
public function IncreaseRunningTotal(a as boolean) as boolean
if a then
RunningTotal= 1
return true
end if
RunningTotal= RunningTotal+ 1
return false
end function
Step 2 Increment :
=Code.IncreaseRunningTotal( False)
Step 3: reset
=Code.IncreaseRunningTotal(true)
Step 4 Display
=Code.RunningTotal
SIMPLE!
—-Last Day of Previous Month
SELECT DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,GETDATE()),0))
LastDay_PreviousMonth
—-Last Day of Current Month
SELECT DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,GETDATE())+1,0))
LastDay_CurrentMonth
—-Last Day of Next Month
SELECT DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,GETDATE())+2,0))
LastDay_NextMonth
dateadd(m, datediff(m, 0, dateadd(m, 2, @MyDate)), -1);
SELECT DAY(DATEADD (m, 1, DATEADD (d, 1 – DAY(GETDATE()), GETDATE())) – 1)

Microsoft has the gloves off and is ready to rumble.
It proudly shows 6 compelling reasons to switch to SQL Server from Oracle on their Microsoft in Government site.
http://www.microsoft.com/industry/government/products/server/sql2008.mspx#WhySwitch
Has Microsoft really surpassed Oracle?
Well their site claims so..:
| SQL Server 2008 | Oracle | |
|
Performance and Scalability |
1 |
1 |
|
Business Intelligence |
1 |
|
|
Total Cost of Ownership |
1 |
|
|
Stronger Partner Ecosystem |
1 |
|
|
Better Together with Microsoft Office |
1 |
|
|
Security |
1 |
|
|
Total |
6 |
1 |
Round 2 of the Database wars appears to be on. Microsoft appears to have taken the first shot!
REAL TIME REPORTING, not NEAR, NOT Yesterday.. NOW!
SQL SERVER 2008 R2, a bold new era of some great new features. I wanted to share one that I have been looking at recently.
STREAMINSIGHT
The short of it is that you can now monitor a real time data stream for reports and or alerts. This has been a long time coming and finally closes an open hole in the Microsoft reporting strategy.
Recently one of Microsoft’s ISV’s talked about how much it saved them being able to monitor the real time stream, rather than storing all of the data, they were able to store exceptions, and averages saving 100’s of gigabytes of data per day.
http://www.microsoft.com/sqlserver/2008/en/us/R2-complex-event.aspx
OK, this is the best blog update tools that I’ve seen in a while. It’s simple to use, a clean interface and its free.
http://windowslivewriter.spaces.live.com/default.aspx
Don’t forget to check out all the plug ins too! Great Job Microsoft!!
http://gallery.live.com/default.aspx?l=8
Ubuntu 9,04 is out!
Install Ubuntu on a VPC 2007 :
Boot up and select yoiur language, for me english,
Then press the down arrow to install ubuntu and press f4
Select safe graphics mode
Then press f6
This will pop up a menu press escape and yoiushoyou see the command line, Delete the Quiet and No Spalsh and add
So :
Boot Options seed/ubuntu.seed boot=casper initrd=/casper/initrd.gz quiet splash –
Becomes :
Boot Options seed/ubuntu.seed boot=casper initrd=/casper/initrd.gz vga=791 noreplace-paravirt
Press enter and the installation should begin!
It runs slow, so be patient during the install
then edit the GRUB Menu and add the same change to the kernal option..
then mod yoiur x11 screen res :
You need to edit /etc/X11/xorg.conf Here's what I have: Section "InputDevice" Identifier "Generic Keyboard" Driver "kbd" Option "XkbRules" "xorg" Option "XkbModel" "pc104" Option "XkbLayout" "us" EndSection Section "InputDevice" Identifier "Configured Mouse" Driver "mouse" Option "CorePointer" EndSection Section "Device" Identifier "Configured Video Device" Driver "vesa" #Option "UseFBDev" "true" EndSection Section "Monitor" Identifier "Configured Monitor" HorizSync 30-70 VertRefresh 50-160 EndSection Section "Screen" Identifier "Default Screen" Monitor "Configured Monitor" Device "Configured Video Device" DefaultDepth 16 SubSection "Display" Depth 16 Modes "1024x768" "896x600" "800x600" EndSubSection EndSection Section "ServerLayout" Identifier "Default Layout" Screen "Default Screen" EndSection
It’s BI TIME!
With the recent announcement of the integration of SharePoint and the Performance Point Analytics and Monitoring parts it’s time to get the ball rolling on your implementations.
Microsoft has been so kind as to put up one of the top OLAP analysis tools for consumer to download and evaluate.
If you have not seen this product before, then you are missing out, there are very few tool available that can do anything even close to what this one can.
Don’t believe me? Well, try it for yourself!
Microsoft ProClarity Desktop Professional Evaluation 6.3
Microsoft ProClarity Analytics Server 6.3.Evaluation