Quick code snippet to group a recordset by week. In this case we are summing hours worked per week. SELECT DATEPART(YEAR,myDateField) AS ‘Year’, DATEPART(wk,myDateField) AS ‘Week #’, MIN(DATEADD(wk, DATEDIFF(wk,0,myDateField), 0)) AS ‘Week date’, SUM(COALESCE([Hours],0)) AS ‘Hours’ FROM…
Author: Cliff Richardson
“Approve” Multiple records in a GridView
Every once in a while you have a list of records that need to be “approved by a manager.” You could select the records via a filter, but that always gets a little cumbersome because there’s always one record you…
SQL – Creating and Dropping Temp Tables
I run into this all the time but can’t ever remember the syntax. First, check to see if it exists and if it does, drop it. IF OBJECT_ID(‘tempdb..#MyTempTable’) IS NOT NULL Drop Table #MyTempTable Second, build your table. The “#”…
Navigating Excel Cells in VBA
Fixed Reference There’s plenty of documentation on how to move around Excel in VBA if you know exactly what cell you want to move to. For example to move to cell D3 all you need to do is add this…
Orphaned SQL Server Users
The Scenario: You’re working on a SQL database locally and when you restore the database on the production server the login no longer works. The user has been orphaned. Solution #1 – Delete and recreate the user from scratch Solution…
Care and Feeding of SQLParameters and SQLHelper
I chased my tail for hours on this one, but finally found the combination that works. Here’s the basic layout Function GetProjects(ID as int64, Name as string) Dim arParams As SqlParameter() = New SqlParameter(2) {} arParams(0) = New SqlParameter(“@ID”, IIf(ID…
How to Uninstall a DotNetNuke module
These instructions cover uninstalling a module from DotNetNuke 05.06.03, but should be good for DotNetNuke 5 installs. If you are having trouble with a module on a particular page and are unable to remove it from the page, uninstalling the…
How to Manually Install a DotNetNuke Module
These instructions cover setting up a dynamic DotNetNuke module in Visual Studio 2010 and manually installing the module in DotNetNuke. While these instructions are based on DotNetNuke 05.06.03 they are applicable to all of DotNetNuke 5 versions. These instructions do…
How to Create a Module Install Package (Basic)
These instructions cover creating a basic Install Package for DotNetNuke version 05.06.03 (45). Stay tuned for updates on more complex installs. assume that you have successfully manually installed your module and that the App_Code and DesktopModules folders contain all the…
Retrieve Dot Net Nuke Custom Module Settings
If you’re creating custom modules for DotNetNuke you’ve certainly tried to add your own settings to the settings.ascx in the default module setup. Creating your settings happens in 5 steps. Where ever you see “settingname” replace with your setting’s name:…