SQL Query of the Day — Group By Year

This fellow has a blog, and it’s good: Grouping datetime by date in T-SQL « SQL Disco.  Many times in SQL you need to group by year, or by date, and what you have to work with is a big nasty DATETIME field.  I needed to find out how many updates had been done each year, and I had gnat’s ass quality timestamps, down to the second.

I know what you’re thinking, but if you use CONVERT(dtgMyDate), you’re doing it wrong, as our friend at SQL DISCO points out.  In his example, he groups by day; in this one, I have modified it to group by year:

SELECT DATEADD(yyyy,(DATEDIFF(yyyy,0,dtgMyDate)),0),
COUNT(*)
FROM Table1 GROUP BY DATEADD(yyyy,(DATEDIFF(yyyy,0,dtgMyDate)),0)

You see what he does there? Instead of costly CONVERT, … Continue reading

Planks of a Platform

I’ll use this post to collect some thoughts about planks, a platform for Tea Party activism.

I view the Tea Party not so much as a social conservative movememt, but a no-kidding Constitutional and financial movement which has symbiotoc relationship with many constituencies, some of which are opposed to one another. Therefore, the proper business of a successful Tea Party is to maintain as narrow a focus as possible, and to be as serious as possible in that goal, so that not only does it not alienate constituents through unnecessary distinctions, but it also makes the case for its core concerns in a convincing enough manner that the constituents are content to walk with one another for a time at any rate.

So the gay rights people and … Continue reading

Ethical Resistance to Communism in the U.S. Government

This is a working document which I will make public in the interests of doing better work.  I’ll use this post to collect some thoughts about how to conduct oneself in an ethical resistance to the creeping plagues upon our Republic.

First and foremost is that no matter how it is formulated I am not interested in any resistance which does not begin and end with an ethical stance toward the job at hand.

One thing that is clear is that there are a lot of well-intended people out there who step in poo in some form or other, and stink the party up. These folks reveal themselves early, as they are not hiding. There are also some bad actors, who go malignant after wheedling their way in … Continue reading

A Crucible for the GOP and the Tea Party

Right now is a deceptively important point in time. The Democrats know this, and so do the status quo Republicans.

Tea Party frustration with establishment Republicans is at levels not seen since 2009. The Obama administration is burying (Barrying?) us with the paper equivalent of human-wave attacks. We have a primary election to start worrying about, which will have us at each other’s heels for a while.

It has been long enough since the smashing Tea Party victory that the thrill has faded a bit, and certainly been doused with cold water by GOP cronyism like Hal “14-term Prince of Pork” Rogers being appointed Chairman of Appropriations, for crying out loud. It is also such a long way to the next election that polls are meaningless, allegiances are … Continue reading

The Marxism of President Obama: The Mask Falls (1)

This is actually my second post on this topic, but this is the incident which made his chosen trajectory clear to me. President Obama’s speech of February seventh to the United States Chamber of Commerce was stunning not only for its fall-flat lack of any accomplishment, but more notably for the bald-faced affirmation of Marxist principles.

The speech is a watershed moment in this Presidency, and I feel will be studied from a bit more historical a perspective, given the passage of some time. I won’t spend overlong on details, as the speech can be seen on YouTube (here, here) and certainly is available from the White House. The speech is a half-hour of mostly repetitive formulations of three things: a flawed analysis of what … Continue reading

The Marxism of President Obama

One of the hallmarks of Marxism is a fundamental misunderstanding of the way that capital works. The President displays this ignorance proudly as he blames “speculators” for rising oil prices.   I quote:

“The problem is, is that oil is sold on these world markets, and speculators and people make various bets, and they say, ‘you know what, we think that maybe there’s a 20 percent chance that something might happen in the Middle East that might disrupt oil supply,’” he said.
“‘So we’re going to bet that oil is going to go up real high.’ And that spikes up prices significantly,” said the president, who recently launched his reelection campaign.

That’s his assessment of the root cause: evil borrowers and lenders are manipulating markets for … Continue reading