Friday, July 25, 2014

Excel Import to SQL Increase Cell Size Scan via Registry

http://forums.asp.net/t/1578417.aspx?REGEDIT+TypeGuessRows+Windows+7

I know it's been forever since your post, but I had this issue as well and found out that if you're running Windows 7 64-bit, the location has changed:
My Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Jet\4.0\Engines\Excel

Wednesday, July 16, 2014

Rank and counting within subgroups

This was done for the inspector Report.

So this is in the select statement:

,G.[Total Number of Inspections on Permit]
,rank() over (PARTITION BY [b1_alt_id] ORDER BY COALESCE([G6ACTION].[G6_COMPL_DD],[G6ACTION].[G6_ACT_DD],G6_ACT_NUM) DESC, G6_ACT_NUM DESC) AS 'Order Number'


And here is the outer apply for the total count within a given record:

OUTER APPLY (SELECT COUNT(DISTINCT [G6_ACT_NUM]) AS 'Total Number of Inspections on Permit'
FROM [G6ACTION] g6a
WHERE g6a."SERV_PROV_CODE" = B1P."SERV_PROV_CODE"
AND g6a."B1_PER_ID1" = B1P."B1_PER_ID1"
AND g6a."B1_PER_ID2" = B1P."B1_PER_ID2"
AND g6a."B1_PER_ID3" = B1P."B1_PER_ID3" AND G6A.[REC_STATUS] = 'A' AND COALESCE(g6a.[G6_ACT_DD],g6a.[G6_COMPL_DD],'') BETWEEN @startdate
AND DATEADD(d, 1, @enddate)
and (
(ISNULL(@InspectorName, '') = '')
OR (
ISNULL([GA_FNAME], '') + CASE
WHEN ISNULL([GA_MNAME], '') = ''
THEN ' '
ELSE ' ' + [GA_MNAME] + ' '
END + ISNULL([GA_LNAME], '') = @InspectorName
)
) ) AS G

Thursday, July 10, 2014

Closed Conditions

AND ISNULL([B1PERMIT].[B1_APPL_STATUS], '') <> 'CofO Issued'
AND ISNULL([B1PERMIT].[B1_APPL_STATUS], '') <> 'Closed'

AND ISNULL(B1P1.b1_appl_status,'')  not in ('cancelled','Classified Abandon','Closed','CC Issued','Classify Abandoned','CofO Issued','Duplicate','Duplicate Record','Void')