Wednesday, 27 June 2012

sum of hours between two dates in sql

SELECT
    CONVERT(VARCHAR(6), DATEDIFF(SECOND, '2012-06-26 03:00:00.000', '2012-06-27 23:30:00.000')/3600) + ':'
    + RIGHT('0' + CONVERT(VARCHAR(2), (DATEDIFF(SECOND, '2012-06-26 03:00:00.000', '2012-06-27 23:30:00.000') % 3600) / 60), 2) + ':'
    + RIGHT('0' + CONVERT(VARCHAR(2), DATEDIFF(SECOND, '2012-06-26 03:00:00.000', '2012-06-27 23:30:00.000') % 60), 2)

courtesy Mr.Vanthiya Thevan

Tuesday, 19 June 2012

mouse wheel working in VB6 IDE

http://support.microsoft.com/kb/837910
Download the VB6 Mouse Wheel.exe file that includes the add-in DLL and the code that is used to create the add-in DLL.
  1. Download the VB6 Mouse Wheel.exe file. The following file is available for download from the Microsoft Download Center:
    Download
    download dll
    For more information about how to download Microsoft support files, click the following article number to view the article in the Microsoft Knowledge Base:
    119591  How to obtain Microsoft support files from online services
    Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help prevent any unauthorized changes to the file.
  2. Click Start, click Run, type regsvr32 <path>\VB6IDEMouseWheelAddin.dll, and then click OK.
  3. Start Visual Basic 6.0.
  4. Click Add-Ins, and then click Add-in Manager.
  5. In the Add-in Manager list, click MouseWheel Fix.
  6. Click to select the Loaded/Unloaded check box, and then click to select the Load on Startup check box.
  7. Click OK.
Try it your own risk...

Monday, 18 June 2012

To find which installer you have installed in windows

go to c:\windows\system32 and locate the file msi.dll right click on that file-properties-version thats it.

start - run- msiexec press enter key.

kill a process using name and id

Just run it like this to use the process name.
TASKKILL /F /IM "notepad.exe"
Or this to kill it based on the process ID:
TASKKILL /F /PID 1234

start->run-> c:\> TASKKILL /F /IM "notepad.exe" press enter

the task will terminate.

Monday, 4 June 2012

To Know the SQL Server Edition and Version

SELECT 'SQL Server '
+ CAST(SERVERPROPERTY('productversion') AS VARCHAR) + ' - '
+ CAST(SERVERPROPERTY('productlevel') AS VARCHAR) + ' ('
+ CAST(SERVERPROPERTY('edition') AS VARCHAR) + ')'