Cummulative Total

Feb 23, 2007

I'm trying to show a running sum on a set of records ordered by
Date and Order Number to prioritize shipments by first-in-first-out.


CREATE TABLE #TMP (
DUE_DATE DATETIME,
ORD_NUM CHAR(10),
PRODUCT CHAR(3),
TONS REAL)

INSERT INTO #TMP
SELECT '2/23/07', '07026.0030', 'ABC', 3.375
UNION ALL
SELECT '2/23/07', '07047.0059', 'ABC', 3.375
UNION ALL
SELECT '2/23/07', '07053.0080', 'ABC', 3.375
UNION ALL
SELECT '2/24/07', '07045.0030', 'ABC', 2.25
UNION ALL
SELECT '2/25/07','07045.0027','ABC',1.125
UNION ALL
SELECT '2/25/07','07046.0070','ABC',6.75

SELECT T1.PRODUCT, T1.DUE_DATE, T1.ORD_NUM, T1.TONS,
'TTL_TONS'=(SELECT SUM(TONS) AS CUMM
FROM #TMP T2
WHERE T1.DUE_DATE>=T2.DUE_DATE AND T1.ORD_NUM>=T2.ORD_NUM )
FROM #TMP T1

DROP TABLE #TMP


The first 3 records returned show the right numbers in the ttl_tons column,
but then it falls apart after that?

Any hints?

View 14 Replies


ADVERTISEMENT

Cummulative

Jan 19, 2005

I'm having trouble creating a cummulative column in a table.

I've got the following table, sorted ASC PAID

Claim_Number Paid
123 $21.22
124 $34,87
456 $42.90
478 $67.00
890 $100.10

I want to add a column (in a new table) with the cummulative total paid. It should look like

Claim_Number Paid Cummulative
123 $21.00 $21.00
124 $34.00 $55.00
456 $42.00 $97.00
478 $67.00 $164.00
890 $100.00 $264.00


Thanks for the help.

Ray

View 9 Replies View Related

Error Installing Cummulative Update 4

May 28, 2008

Hi,

I am consulting for a client who would like to install Cummulative Update 4 on their server. We have tested it with no issues on their development and testing servers, but when I attempted the install in the production environment, the installer threw an error saying that the target software is not installed. The logs are included below. It is a 64 bit server that is running in a Veritas cluster, is a named instance, and is SP2.

For the main SQL Server Components:


=== Verbose logging started: 5/5/2008 18:48:18 Build type: SHIP UNICODE 3.01.4000.2435 Calling process: s:90cb035184951b50b6hotfix.exe ===
MSI (c) (90:0C) [18:48:18:604]: Resetting cached policy values
MSI (c) (90:0C) [18:48:18:604]: Machine policy value 'Debug' is 0
MSI (c) (90:0C) [18:48:18:604]: ******* RunEngine:
******* Product: {26F1A218-3158-4107-B3A6-37FD61CEE969}
******* Action:
******* CommandLine: **********
MSI (c) (90:0C) [18:48:18:604]: Client-side and UI is none or basic: Running entire install on the server.
MSI (c) (90:0C) [18:48:18:604]: Grabbed execution mutex.
MSI (c) (90:0C) [18:48:18:620]: Cloaking enabled.
MSI (c) (90:0C) [18:48:18:620]: Attempting to enable all disabled priveleges before calling Install on Server
MSI (c) (90:0C) [18:48:18:635]: Incrementing counter to disable shutdown. Counter after increment: 0
MSI (s) (28:1C) [18:48:18:651]: Grabbed execution mutex.
MSI (s) (28:A4) [18:48:18:651]: Resetting cached policy values
MSI (s) (28:A4) [18:48:18:651]: Machine policy value 'Debug' is 0
MSI (s) (28:A4) [18:48:18:651]: ******* RunEngine:
******* Product: {26F1A218-3158-4107-B3A6-37FD61CEE969}
******* Action:
******* CommandLine: **********
MSI (s) (28:A4) [18:48:18:651]: Machine policy value 'DisableUserInstalls' is 0
MSI (s) (28:A4) [18:48:18:651]: Adding MSIINSTANCEGUID to command line.
MSI (s) (28:A4) [18:48:18:651]: End dialog not enabled
MSI (s) (28:A4) [18:48:18:651]: Original package ==> C:WINDOWSInstaller1504f0.msi
MSI (s) (28:A4) [18:48:18:651]: Package we're running from ==> C:WINDOWSInstaller1504f0.msi
MSI (s) (28:A4) [18:48:18:667]: APPCOMPAT: looking for appcompat database entry with ProductCode '{26F1A218-3158-4107-B3A6-37FD61CEE969}'.
MSI (s) (28:A4) [18:48:18:667]: APPCOMPAT: no matching ProductCode found in database.
MSI (s) (28:A4) [18:48:18:667]: Detected that this product uses a multiple instance transform.
MSI (s) (28:A4) [18:48:18:667]: MSCOREE not loaded loading copy from system32
MSI (s) (28:A4) [18:48:18:667]: Applying multiple instance transform 'qlRun01.mst'...
MSI (s) (28:A4) [18:48:18:667]: Looking for storage transform: SqlRun01.mst
MSI (s) (28:A4) [18:48:18:667]: Validating transform 'SqlRun01.mst' with validation bits 0x809
MSI (s) (28:A4) [18:48:18:667]: Transform 'SqlRun01.mst' is valid.
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2205 2: 3: Patch
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2205 2: 3: PatchPackage
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _Tables 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _Columns 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: Media 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: File 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: TRANSFORM: 'PatchPackage' table is missing or empty. No pre-transform fixup necessary.
MSI (s) (28:A4) [18:48:18:667]: TRANSFORM: Applying regular transform to database.
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _Tables 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _Columns 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _Validation 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: File 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: MsiFileHash 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: Signature 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: RegLocator 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: AppSearch 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: CompLocator 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: DrLocator 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: Binary 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: CustomAction 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: Directory 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: Registry 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: Condition 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: CreateFolder 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _sqlObjectSecurity 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: Icon 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: InstallExecuteSequence 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: InstallUISequence 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: AdminExecuteSequence 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: AdminUISequence 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: AdvtExecuteSequence 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: AdvtUISequence 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _sqlAction 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _sqlActionsModule 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _sqlDriveType 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: ReserveCost 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: TypeLib 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: Feature 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: MsiAssembly 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: Class 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: Extension 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: PublishComponent 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: ServiceControl 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: ModuleDependency 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: ModuleSignature 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: ModuleExclusion 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: ModuleComponents 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _sqlBuiltInAccounts 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: MsiAssemblyName 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: ServiceInstall 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _sqlNativeImage 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _sqlPropertyValues 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _sqlUserSecurity 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _sqlRegistry 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _sqlServiceControl 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _sqlHiveCopy 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _sqlRegSecurity 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _sqlGroup 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _sqlGroupMember 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _sqlConfig 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _sqlUpgradeScript 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _sqlHotfixScript 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _sqlScript 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: ActionText 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _sqlSku 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _sqlStart 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _sqlServiceAccount 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _sqlDelimitProperty 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _sqlEquivalent 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _sqlWizardSequence 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: Dialog 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _sqlMofcomp 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _sqlWMISecurity 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _sqlInstanceProperty 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _sqlInstanceComponents 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _sqlAssembly 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: Error 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _sqlPerfCounters 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _sqlCollation 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _sqlExecutable 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _sqlFileSR 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _sqlUnmanagedComponent 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _sqlUpgradeComponent 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _sqlProducts 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _sqlTopLevelFeatureProducts 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _sqlFileRename 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _sqlFollowComponents 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _sqlLocalServers 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _sqlVerIndependentProgID 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _sqlServiceState 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _sqlServiceProperty 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _sqlServiceConfig 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _sqlSupportFiles 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _sqlDomainGroup 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: FeatureComponents 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: Control 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: ControlEvent 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: ControlCondition 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: ListBox 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: ListView 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: ComboBox 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: CheckBox 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: EventMapping 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: RadioButton 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: Upgrade 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: TextStyle 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: UIText 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: Media 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: Shortcut 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: SxsMsmGenComponents 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: MsiSFCBypass 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: RemoveFile 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: RemoveRegistry 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: Environment 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _sqlUpgradeFile 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _sqlUpgradeRegistry 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _sqlUpgradeFolders 3: -2147287038
MSI (s) (28:A4) [18:48:18:667]: Note: 1: 2262 2: _MsiPatchTransformView 3: -2147287038
MSI (s) (28:A4) [18:48:18:682]: File will have security applied from OpCode.
MSI (s) (28:A4) [18:48:18:839]: Original patch ==> s:90cb035184951b50b6HotFixSQLFilessqlrun_sql.msp
MSI (s) (28:A4) [18:48:18:839]: Patch we're running from ==> C:WINDOWSInstaller70288546.msp
MSI (s) (28:A4) [18:48:18:839]: SOFTWARE RESTRICTION POLICY: Verifying patch --> 's:90cb035184951b50b6HotFixSQLFilessqlrun_sql.msp' against software restriction policy
MSI (s) (28:A4) [18:48:18:839]: Note: 1: 2262 2: DigitalSignature 3: -2147287038
MSI (s) (28:A4) [18:48:18:839]: SOFTWARE RESTRICTION POLICY: s:90cb035184951b50b6HotFixSQLFilessqlrun_sql.msp is not digitally signed
MSI (s) (28:A4) [18:48:18:839]: SOFTWARE RESTRICTION POLICY: s:90cb035184951b50b6HotFixSQLFilessqlrun_sql.msp is permitted to run at the 'unrestricted' authorization level.
MSI (s) (28:A4) [18:48:18:839]: SequencePatches starts. Product code: {26F1A218-3158-4107-B3A6-37FD61CEE969}, Product version: 9.00.1399.06, Upgrade code: {12EEFC9F-91FB-490B-B00B-7164C31C1650}, Product language 1033
MSI (s) (28:A4) [18:48:18:839]: 3.0 patch s:90cb035184951b50b6HotFixSQLFilessqlrun_sql.msp is of type QFE
MSI (s) (28:A4) [18:48:18:839]: PATCH SEQUENCER: verifying the applicability of QFE patch s:90cb035184951b50b6HotFixSQLFilessqlrun_sql.msp against product code: {26F1A218-3158-4107-B3A6-37FD61CEE969}, product version: 9.00.1399.06, product language 1033 and upgrade code: {12EEFC9F-91FB-490B-B00B-7164C31C1650}
MSI (s) (28:A4) [18:48:18:839]: Validating transform 'Target01ToUpgrade01' with validation bits 0x920
MSI (s) (28:A4) [18:48:18:839]: Note: 1: 2749 2: Target01ToUpgrade01 3: C:WINDOWSInstaller70288546.msp 4: 9.2.3042.00 5: 9.00.1399.06
MSI (s) (28:A4) [18:48:18:839]: 1: 2749 2: Target01ToUpgrade01 3: C:WINDOWSInstaller70288546.msp 4: 9.2.3042.00 5: 9.00.1399.06
MSI (s) (28:A4) [18:48:18:839]: PATCH SEQUENCER: QFE patch s:90cb035184951b50b6HotFixSQLFilessqlrun_sql.msp is not applicable.
MSI (s) (28:A4) [18:48:18:839]: SequencePatches returns success.
MSI (s) (28:A4) [18:48:18:839]: Final Patch Application Order:
MSI (s) (28:A4) [18:48:18:839]: Other Patches:
MSI (s) (28:A4) [18:48:18:839]: UnknownAbsent: {7DE23C0A-B5A2-4059-8D09-78C7EC955D10} - s:90cb035184951b50b6HotFixSQLFilessqlrun_sql.msp
MSI (s) (28:A4) [18:48:18:839]: Product: Microsoft SQL Server 2005 (64-bit) - Update '{7DE23C0A-B5A2-4059-8D09-78C7EC955D10}' could not be installed. Error code 1642. Additional information is available in the log file C:Program FilesMicrosoft SQL Server90Setup BootstrapLOGHotfixSQL9_Hotfix_KB941450_sqlrun_sql.msp.log.

MSI (s) (28:A4) [18:48:18:839]: Note: 1: 1708
MSI (s) (28:A4) [18:48:18:839]: Note: 1: 2729
MSI (s) (28:A4) [18:48:18:839]: Note: 1: 2729
MSI (s) (28:A4) [18:48:18:839]: Product: Microsoft SQL Server 2005 (64-bit) -- Installation failed.

MSI (s) (28:A4) [18:48:18:854]: Attempting to delete file C:WINDOWSInstaller70288546.msp
MSI (s) (28:A4) [18:48:18:854]: MainEngineThread is returning 1642
The upgrade patch cannot be installed by the Windows Installer service because the program to be upgraded may be missing, or the upgrade patch may update a different version of the program. Verify that the program to be upgraded exists on your computer an
d that you have the correct upgrade patch.
C:WINDOWSInstaller1504f0.msi
MSI (c) (90:0C) [18:48:18:854]: Decrementing counter to disable shutdown. If counter >= 0, shutdown will be denied. Counter after decrement: -1
MSI (c) (90:0C) [18:48:18:854]: MainEngineThread is returning 1642
=== Verbose logging stopped: 5/5/2008 18:48:18 ===



And the SSIS log:

=== Verbose logging started: 5/5/2008 18:48:19 Build type: SHIP UNICODE 3.01.4000.2435 Calling process: s:90cb035184951b50b6hotfix.exe ===
MSI (c) (90:18) [18:48:19:167]: Resetting cached policy values
MSI (c) (90:18) [18:48:19:167]: Machine policy value 'Debug' is 0
MSI (c) (90:18) [18:48:19:167]: ******* RunEngine:
******* Product: {85B1D7F9-2B84-4386-9947-8F362E247F0B}
******* Action:
******* CommandLine: **********
MSI (c) (90:18) [18:48:19:167]: Client-side and UI is none or basic: Running entire install on the server.
MSI (c) (90:18) [18:48:19:167]: Grabbed execution mutex.
MSI (c) (90:18) [18:48:19:167]: Cloaking enabled.
MSI (c) (90:18) [18:48:19:167]: Attempting to enable all disabled priveleges before calling Install on Server
MSI (c) (90:18) [18:48:19:167]: Incrementing counter to disable shutdown. Counter after increment: 0
MSI (s) (28:1C) [18:48:19:167]: Grabbed execution mutex.
MSI (s) (28:C4) [18:48:19:167]: Resetting cached policy values
MSI (s) (28:C4) [18:48:19:167]: Machine policy value 'Debug' is 0
MSI (s) (28:C4) [18:48:19:167]: ******* RunEngine:
******* Product: {85B1D7F9-2B84-4386-9947-8F362E247F0B}
******* Action:
******* CommandLine: **********
MSI (s) (28:C4) [18:48:19:167]: Machine policy value 'DisableUserInstalls' is 0
MSI (s) (28:C4) [18:48:19:182]: End dialog not enabled
MSI (s) (28:C4) [18:48:19:182]: Original package ==> C:WINDOWSInstaller1504e7.msi
MSI (s) (28:C4) [18:48:19:182]: Package we're running from ==> C:WINDOWSInstaller1504e7.msi
MSI (s) (28:C4) [18:48:19:198]: APPCOMPAT: looking for appcompat database entry with ProductCode '{85B1D7F9-2B84-4386-9947-8F362E247F0B}'.
MSI (s) (28:C4) [18:48:19:198]: APPCOMPAT: no matching ProductCode found in database.
MSI (s) (28:C4) [18:48:19:198]: File will have security applied from OpCode.
MSI (s) (28:C4) [18:48:19:276]: Original patch ==> s:90cb035184951b50b6HotFixDTSFilessqlrun_dts.msp
MSI (s) (28:C4) [18:48:19:276]: Patch we're running from ==> C:WINDOWSInstaller70288547.msp
MSI (s) (28:C4) [18:48:19:276]: SOFTWARE RESTRICTION POLICY: Verifying patch --> 's:90cb035184951b50b6HotFixDTSFilessqlrun_dts.msp' against software restriction policy
MSI (s) (28:C4) [18:48:19:276]: Note: 1: 2262 2: DigitalSignature 3: -2147287038
MSI (s) (28:C4) [18:48:19:276]: SOFTWARE RESTRICTION POLICY: s:90cb035184951b50b6HotFixDTSFilessqlrun_dts.msp is not digitally signed
MSI (s) (28:C4) [18:48:19:276]: SOFTWARE RESTRICTION POLICY: s:90cb035184951b50b6HotFixDTSFilessqlrun_dts.msp is permitted to run at the 'unrestricted' authorization level.
MSI (s) (28:C4) [18:48:19:276]: SequencePatches starts. Product code: {85B1D7F9-2B84-4386-9947-8F362E247F0B}, Product version: 9.00.1399.06, Upgrade code: {75DE63C9-E446-411B-AF05-8DB2BC905232}, Product language 1033
MSI (s) (28:C4) [18:48:19:276]: 3.0 patch s:90cb035184951b50b6HotFixDTSFilessqlrun_dts.msp is of type QFE
MSI (s) (28:C4) [18:48:19:276]: PATCH SEQUENCER: verifying the applicability of QFE patch s:90cb035184951b50b6HotFixDTSFilessqlrun_dts.msp against product code: {85B1D7F9-2B84-4386-9947-8F362E247F0B}, product version: 9.00.1399.06, product language 1033 and upgrade code: {75DE63C9-E446-411B-AF05-8DB2BC905232}
MSI (s) (28:C4) [18:48:19:276]: Validating transform 'Target01ToUpgrade01' with validation bits 0x920
MSI (s) (28:C4) [18:48:19:276]: Note: 1: 2749 2: Target01ToUpgrade01 3: C:WINDOWSInstaller70288547.msp 4: 9.2.3042.00 5: 9.00.1399.06
MSI (s) (28:C4) [18:48:19:276]: 1: 2749 2: Target01ToUpgrade01 3: C:WINDOWSInstaller70288547.msp 4: 9.2.3042.00 5: 9.00.1399.06
MSI (s) (28:C4) [18:48:19:276]: PATCH SEQUENCER: QFE patch s:90cb035184951b50b6HotFixDTSFilessqlrun_dts.msp is not applicable.
MSI (s) (28:C4) [18:48:19:276]: SequencePatches returns success.
MSI (s) (28:C4) [18:48:19:276]: Final Patch Application Order:
MSI (s) (28:C4) [18:48:19:276]: Other Patches:
MSI (s) (28:C4) [18:48:19:276]: UnknownAbsent: {C958BA39-762E-4E13-87E8-A4F28457317B} - s:90cb035184951b50b6HotFixDTSFilessqlrun_dts.msp
MSI (s) (28:C4) [18:48:19:276]: Product: Microsoft SQL Server 2005 Integration Services (64-bit) - Update '{C958BA39-762E-4E13-87E8-A4F28457317B}' could not be installed. Error code 1642. Additional information is available in the log file C:Program FilesMicrosoft SQL Server90Setup BootstrapLOGHotfixDTS9_Hotfix_KB941450_sqlrun_dts.msp.log.
MSI (s) (28:C4) [18:48:19:276]: Note: 1: 1708
MSI (s) (28:C4) [18:48:19:276]: Note: 1: 2729
MSI (s) (28:C4) [18:48:19:276]: Note: 1: 2729
MSI (s) (28:C4) [18:48:19:276]: Product: Microsoft SQL Server 2005 Integration Services (64-bit) -- Installation failed.
MSI (s) (28:C4) [18:48:19:292]: Attempting to delete file C:WINDOWSInstaller70288547.msp
MSI (s) (28:C4) [18:48:19:292]: MainEngineThread is returning 1642
The upgrade patch cannot be installed by the Windows Installer service because the program to be upgraded may be missing, or the upgrade patch may update a different version of the program. Verify that the program to be upgraded exists on your computer an
d that you have the correct upgrade patch.
C:WINDOWSInstaller1504e7.msi
MSI (c) (90:18) [18:48:19:292]: Decrementing counter to disable shutdown. If counter >= 0, shutdown will be denied. Counter after decrement: -1
MSI (c) (90:18) [18:48:19:292]: MainEngineThread is returning 1642
=== Verbose logging stopped: 5/5/2008 18:48:19 ===

View 2 Replies View Related

Total Page Writes/total Amount Of Data Change In A Set Period Of Time

Jun 9, 2004

Does anyone know how I can determine the number of page writes that have been performed during a set period of time? I need to figure out the data churn in that time period.

TIA

View 5 Replies View Related

Aggregated Subquery - Sum Total Trips And Total Values As Separate Columns By Day

Feb 26, 2014

Very new to SQL and trying to get this query to run. I need to sum the total trips and total values as separate columns by day to insert them into another table.....

My code is as follows;

Insert Into [dbo].[CombinedTripTotalsDaily]
(
Year,
Month,
Week,
DayNo,
Day,
Trip_Date,

[Code] .....

View 3 Replies View Related

Query By Year Group By Total Students Sort By Total For Each County

Jul 20, 2005

I haven't a clue how to accomplish this.All the data is in one table. The data is stored by registration dateand includes county and number of students brokne out by grade.Any help appreciated!Rob

View 4 Replies View Related

Reporting Services :: SSRS Group Total Expression - Add Total Disabled

Oct 26, 2015

For some reason my Add Total is grey out, when i tried to add grand total using some expression.

I have two row & two column groups?

Is there any alternative or how can i enable add total? using expression..as you can see in my Attached Image

I'm using iff condition in my expression.. 

View 15 Replies View Related

SQL Server 2008 :: Pulling Daily Total From Cumulative Total

Jun 28, 2015

I have a table that writes daily sales each night but it adds the day's sales to the cumulative total for the month. I need to pull the difference of todays cumulative total less yesterdays. So when my total for today is 30,000 and yesterday's is 28,800, my sales for today would be 1,200. I want to write this to a new field but I just can't seen to get the net sales for the day. Here is some sample data. For daily sales for 6-24 I want to see 2,000, for 6-25 3,000, 6-26 3,500, and 6-27 3,500. I'm thinking a case when but can't seem to get it right.

CREATE TABLE sales
(date_created date,
sales decimal (19,2))
INSERT INTO sales (date_created, sales)
VALUES ('6-23-15', '20000.00'),
('6-24-15', '22000.00'),
('6-25-15', '25000.00'),
('6-26-15', '28500.00'),
('6-27-15', '32000.00')

View 9 Replies View Related

Total Record Count - Pagination With Total Rows

Jul 26, 2013

My table contains 1000 records,

I need to know the total record count with the below paging query

SELECT EmpName,Place
FROM EmplyeeDetails ORDER BY Place
OFFSET 10 ROWS FETCH NEXT 10 ROWS ONLY;

How to get?

View 2 Replies View Related

Adding Subreport Total To Main Report Total

Apr 28, 2006

Hi, can anyone help?

I have created a Report using Visual studio-the report displays a subreport within it.

On the Subjective Report I have 12 values for each month of the year.

For the first month the value is =sum(Fields! Month_1.Value), and I
have named this text box €™SubRepM1€™
The name of the subreport is €˜subreport1'.

On my Main Report, again I have 12 values for each month of the year.
For the first month the value is =sum(Fields! Month_1.Value)*-1, and I
have named this text box 'MainRepM1'
The name of the main report is 'GMSHA Budget Adjustment Differentials'

The report displays both of the subreport and main report values
but I now need to total these values together for each month in order to
produce a grand total.

I have tried using the following to add the totals for Month 1 together,
=subreport1.Report.SubRepM1 + MainRepM1
but this does not work and I get the following error message €˜The value expression for the text box 'textbox18'contains an error [BC30451] Name subreport1 is not declared'.

I feel that it should be a simple matter of adding the two sets of values together but I€™m having major problems trying to get these totals to work.

Can anyone help, thanks

View 7 Replies View Related

Total Spaceused And Total Allocated

Jul 20, 2005

Anyone has a "one sql statement" to get the total spaceused and totalspace allocated of an instance ? ie same as sum of relevance fieldsfrom sp_spaceused for each database in an instance, that works accrossversion of mssql from 6 onward.ThanksKD

View 1 Replies View Related

Calculating The Total Amount Of Drugs Prescribed, Total Amount

Aug 10, 2006

Hi all,



I have a table named Prescription that consists of attributes like PatientId, MedicineCode, MedicineName, Prices of different drugs, quantity of different drugs(e.g 1,2,3,10), date .

I would like to get a summary of the total number and amount of different drugs in a specific period, the total amount of each type of drug.



I kindly request for help.

Thanx in advance.

Ronnie

View 4 Replies View Related

Please Help =IIf(IsError([total]),,[total])

Feb 29, 2008

Hi,

I am trying to create a report on some data. I have about 8 tables and 30+ queries attached to those 15 reports. In one of those reports I want to get the percentage based on the data in the tables and queries. Say I have the minimum hours for an employee as 176 hours and the employee works for 227 hours in a month. I want to see the result in percentage.

My report looks something like this :

ID Name Oct Nov Dec Jan Feb March Total
001 alex 87.6% 104.1% 65.1% 50.2% 85.6%
002 Linda 87.4% 109.1% 68.1% 35.2% 90.8%
003 Jon 87.6% 104.1%
004 alex 87.6% 104.1% 65.1% 50.2% 85.6%
005 Linda 87.4% 109.1% 68.1% 35.2% 90.8%

For the 002 ID, though he has worked for Nov and Dec the total % is blank.

The formula that I used for all of these entries is :

=IIf(IsError([total]),"",[total])

and for the month it is : =IIf(IsError([Oct]),"",[oct]), nov and so on.

It works fine for all, but where ever there is blank in one field it doesn;t calculates for the others too..

Please help, how can I get the total for all.

Thanks,


Farn

View 1 Replies View Related

Total Sales By Customer Vs Total Sales

Nov 26, 2007



I have a report which totals sales by customer. Then table footer has a grand total of all customer sales. I would like to get a percent of each customer's sales against the total sales. How do I get the sum from the table footer to use in an individual customer row?

Thanks.

View 3 Replies View Related

Getting Total From Row

Mar 16, 2006

I have built a query in Access that calculates the total to be charged to clients based on 3 cost columns.

I have tried to run the query in MSSQL but it will not run, so could someone help me out with the syntax in my query.

I have done about half of it myself but I am stuck on the calculation and I havent a clue of the syntax to be used.

This is my Access Query;
SELECT DISTINCT Holiday_Bookings.ClientID,
Holiday_Bookings.Booking_Cost,
Room_Facilities.FacilityCost,
Rooms.CostPerNight, Rooms!CostPerNight*Nights_Stayed+Holiday_Bookings! Booking_Cost+Room_Facilities!FacilityCost AS TotalCost,
[TotalCost]*17.5/100+[TotalCost] AS [Total+VAT]
FROM Room_Facilities
INNER JOIN (Hotels INNER JOIN (Holiday_Bookings RIGHT JOIN Rooms ON Holiday_Bookings.ClientID = Rooms.ClientID)
ON Hotels.HotelID = Rooms.HotelID) ON Room_Facilities.FacilityID = Rooms.FacilityID;

and this is what I have managed to salvage in MSSQL format:
SELECT
Holiday_Bookings.ClientID,
Holiday_Bookings.Booking_Cost,
Rooms.CostPerNight,
Room_Facilities.FacilityCost
FROM
Rooms
INNER JOIN Holiday_Bookings ON (Rooms.Clients_ID = Holiday_Bookings.ClientID)
INNER JOIN Room_Facilities ON (Rooms.FacilityID = Room_Facilities.FacilityID)


Any help would be great as I am completely lost.

View 9 Replies View Related

Get A Total

Oct 19, 2006

Hello Everyone,

How can I get the total of the loan numbers:


USE CHEC
SELECT DISTINCT
DAT01.[_@051] AS Branch,
DAT01.[_@550] AS LoanType,
convert(varchar(10), DAT01.[_@040], 110) AS Date,
DAT01.[_@LOAN#] AS LoanNum
FROM DAT01 INNER JOIN [DATE_CONVERSION_TABLE_NEW]
ON DAT01.[_@040] = [_@040]
INNER JOIN [SMT_BRANCHES]
ON DAT01.[_@051] = SMT_BRANCHES.[BranchNbr]
WHERE
DAT01.[_@040] Between '06/01/2006' And '06/30/2006'
AND DAT01.[_@051] = '540'
And DAT01.[_@LOAN#] Like '2%'
And DAT01.[_@550] = '3'
GROUP BY
DAT01.[_@051],
DAT01.[_@550],
DAT01.[_@TP],
DAT01.[_@040],
DAT01.[_@LOAN#]
ORDER BY
DAT01.[_@051]


Where obviously DAT01.[_@LOAN#] is the LoanNum column.

TIA



Kurt

View 6 Replies View Related

Getting SUM Total

Jan 24, 2007

I have the following query which gives me a list of names, logins, and group name along with a count of how many training modules each individual has sat. This returns 70 rows with each individuals details and totals.

However I want to be able to report instead just the total modules sat for all 70 rows instead of displaying each row individually. This is the query I am using:

SELECTpps_principals.name AS pname, EXT_USER_GROUPS.LOGIN, EXT_USER_GROUPS.NAME,
COUNT(PPS_SCOS.SCO_ID) AS coursecount
FROMPPS_PRINCIPALS
LEFT JOINPPS_TRANSCRIPTS ON PPS_TRANSCRIPTS.PRINCIPAL_ID = PPS_PRINCIPALS.PRINCIPAL_ID
AND PPS_TRANSCRIPTS.STATUS like '[PCF]'
AND PPS_TRANSCRIPTS.TICKET not like 'l-%'
AND pps_transcripts.date_created between '2006-10-01' and '2007-09-30'
LEFT JOINPPS_SCOS ON PPS_SCOS.SCO_ID = PPS_TRANSCRIPTS.SCO_ID
AND pps_scos.name like 'MT%'
LEFT JOIN EXT_USER_GROUPS ON EXT_USER_GROUPS.LOGIN = PPS_PRINCIPALS.LOGIN
WHERE pps_principals.login like '%score%' and ext_user_groups.name like 'ALL SCORE PTY'
AND dbo.PPS_PRINCIPALS.DISABLED IS NULL
GROUP BY pps_principals.name, EXT_USER_GROUPS.LOGIN, EXT_USER_GROUPS.NAME
HAVING COUNT(PPS_SCOS.SCO_ID) > 0
ORDER BY pps_principals.name, EXT_USER_GROUPS.LOGIN, EXT_USER_GROUPS.NAME

I am trying to use SUM to get the overall total but without success so far.

Any help gratefully received.

View 2 Replies View Related

Sum (Total)

May 22, 2007

I need to sum the totals for each of the ratings, then group them by owneridname. the problem i am having is that the "Count(*) as total" returns a total that includes ratings that are not listed below as a criteria.

Eg. the total for all ratings for a user john would be 789.
that figure would inlcude amounts for a rating eg. dead. that is not in the list below. please help.

SELECT owneridname, SUM(CASE WHEN new_ratingname = 'Hot' THEN 1 ELSE 0 END) AS Hot,
SUM(CASE WHEN new_ratingname = 'warm' THEN 1 ELSE 0 END) AS Warm, SUM(CASE WHEN new_ratingname = 'cold' THEN 1 ELSE 0 END) AS Cold,
SUM(CASE WHEN new_ratingname = 'cool' THEN 1 ELSE 0 END) AS Cool, SUM(CASE WHEN new_ratingname = 'new' THEN 1 ELSE 0 END) AS New,
SUM(CASE WHEN new_ratingname = 'Reservation Holder' THEN 1 ELSE 0 END) AS [Reservation Holder],
SUM(CASE WHEN new_ratingname = 'site visit' THEN 1 ELSE 0 END) AS [Site Visit], SUM(CASE WHEN new_ratingname IS NULL THEN 1 ELSE 0 END)
AS [Not Rated], SUM(CASE WHEN new_ratingname = 'Continous Updates' THEN 1 ELSE 0 END) AS [Cont Updates],
SUM(CASE WHEN new_ratingname = 'worked tasks' THEN 1 ELSE 0 END) AS [Wkd Tasks], COUNT(*) AS Total
FROM FilteredContact AS filteredcontact
WHERE (statuscodename = 'active')
GROUP BY owneridname

Melvin Felicien
IT Manager
DCG Properties Limited

View 4 Replies View Related

Help With Total

Oct 29, 2007

HI everyone, I been looking for the answer for sometime now, thought i would post and see if anyone could help me it. This is the output of my query.

F_DivDiv_4Div_5Div_35
424600
504000
3510114

After the row 35 i want to add a row for total. I want to add the values of column Div_4 so it would be 246+0+1. The problem i'm having is that the columns are populated from using this logic.

Select
rr.F_BVT_DIV_NO,
(Case When rr3.F_DIVISION_NO = 4 then Max(rr3.Total_Pol_Count) else 0 end ) + (MAX(isnull(rr2.Div4,0))) Div_4

from RNEWL_RTENTN_DETL RR
--join for division 4 transfers

left join(

select
rr2.F_BVT_DIV_NO,
count(rr2.X_POLICY_NO) As Div4
from RNEWL_RTENTN_DETL RR2
where
RR2.F_BVT_DIV_NO<>RR2.F_DIVISION_NO
and month(RR2.X_POLICY_XPRTN_DT)=2 and
year(RR2.X_POLICY_XPRTN_DT)=2007 and
rr2.F_DIVISION_NO = 4
Group By
rr2.F_BVT_DIV_NO ) rr2 on
rr2.F_BVT_DIV_NO = rr.F_BVT_DIV_NO

from TRNEWL_RTENTN_DETL rr3
where
month(rr3.X_POLICY_XPRTN_DT)=2 and
year(rr3.X_POLICY_XPRTN_DT)=2007
Group by
rr3.F_DIVISION_NO) rr3 on
rr3.F_DIVISION_NO = rr.F_BVT_DIV_NO
group by
rr.F_BVT_DIV_NO,
rr3.F_DIVISION_NO
order by
rr.F_BVT_DIV_NO

That code is just a little piece of it, but the logic is the same throughout. Thanks for the input!

View 1 Replies View Related

Getting A Total From A Total

Mar 29, 2007

basically I need to sum the value of one group from another group.



Is this possible yet?

View 7 Replies View Related

% Of Total

Aug 28, 2007

I have a matrix report built on a database not on the cube.

2006
Q1





Volume MS %
Sub Channel Product
X X1 10

X2 20
Subtotal 30
Y Y1 20
Y2 20

Subtotal 40



I need to calculate the Market Share values which are Volume of the product / Subtotal for example

MS% of Product X1 = Volume of X1 / Subtotal i.e 10/ 30 * 100 = 33.33 %

How can i achieve this within the report..Can somebody help/advise...

View 5 Replies View Related

Sub Sub Total

Jan 22, 2007

OK basically what I'm looking for is how to have two subtotals in a report along with a Grand Total.

So it would be something like this:

Revenue

Subtotal

Expense

Subtotal

Grand Total.



The grand total works fine, but I'm not sure how to add the subtotals.

View 3 Replies View Related

Query To Get Total

Feb 12, 2008

Hey all,
I have following query


select Date,

View 5 Replies View Related

Getting Total Of Different Records

Mar 13, 2008

I have a SQL data source and i would like to present the total number of different records based on a "status" field.
I have done total records in the past by doing this:
     protected void SqlDataSource1_Selected(object sender, SqlDataSourceStatusEventArgs e)    {        int RecordCount = e.AffectedRows;            if (RecordCount == 1)            { litRecordCount.Text = "1 record found"; }            else            { litRecordCount.Text = RecordCount.ToString() + " records found"; }        }
This would work, howerver, my SQLdatasource choose * records, and not based on a WHERE condition. Is there any way to total just those with a status of "Initialized" ?
I tried to do it on the Gridview, but then I realized if I have paging on, it will only be on that front page.
thoughts?

View 3 Replies View Related

SQL With A Cummlative Total

Apr 14, 2005

Hello all SQL guru's
 
Is it possible to write an sql statement that will calculate a cummlative total of another field in the sql like below. The BOS column is being calculated an the sql and then the *** column is adding them up.
 
Thanks, Gary











VBS_NO
DIV_NO
ITM_NO
 SLL_DLR 
BOS
***%

609
9
53910
 $          36,270,045
1.24%
1.24%

609
9
53985
 $          31,542,973
1.08%
2.33%

609
9
16870
 $          29,583,159
1.01%
3.34%

609
9
24883
 $          29,532,282
1.01%
4.35%

609
9
39674
 $          27,856,172
0.96%
5.31%

609
9
11485
 $          27,598,356
0.95%
6.26%

609
9
39676
 $          26,933,126
0.92%
7.18%

609
9
33354
 $          23,056,438
0.79%
7.97%

View 2 Replies View Related

Set A 0 Value To Those Record That Have Sum(total) = 0

Sep 28, 2006

Anyone know how to set total = 0, when the sum of that record is 0? Because when sum(total) = 0, the record is not selected anymore.

Like a stat table

Name | Total
----------------
David | 0
John | 10
Sammy | 5
Micheal | 0
Joe | 3
----------------

When displaying those record using SELECT statement, only
John | 10
Sammy | 5
Joe | 3
will be display, and i have to do a checking if the record not here, then assign 0 to them.

I wonder SQL can help to SELECT the records, so no extra work will done on the checking part.
Expert please advice.

View 2 Replies View Related

Help Finding The Max Total

Dec 3, 2004

Hi,

I have the following code

SELECT
PR.WBS2,
SUM(CASE WHEN LedgerAR.Period = '200408' AND LedgerAR.TransType <> 'CR'
THEN Ledgerar.amount * - 1
ELSE '0' END) AS BillExt
FROM PR
LEFT JOIN Ledgerar ON PR.WBS1 = Ledgerar.WBS1 AND
PR.WBS2 = Ledgerar.WBS2 AND PR.WBS3 = Ledgerar.WBS3
WHERE PR.WBS2 <> '98' AND pr.wbs2 <> '9001'
AND pr.wbs2 <> 'zzz' AND pr.wbs3 <> 'zzz' AND
pr.wbs1 = '001-298'
GROUP BY PR.WBS2



It prints out:
Wbs2 BillExt
0141 0
0143 0
1217 20580

I want the code to return the wbs2 code '1217' because it has the highest amount in BillExt '20580'.

Can someone help me with this?

Thanks.
laura

View 10 Replies View Related

Running Total

Mar 8, 2006

Help can anyone see anything wrong with this I am trying to get a running total to show on my form for the users to see, as a team member makes a payment they should be able to see the remaining amount

SELECT SUM(DISTINCT TotalPayments) AS Payment, SUM(AmountDue) AS Due, SUM(FinePayment) AS Fine, [TM #]
FROM dbo.FinePayments_Tbl
GROUP BY [TM #]
HAVING ([TM #] = 9282)

View 2 Replies View Related

Running Total In SQL

Jul 24, 2006

Good day,

I have been trying to figure out how to get a running total using my sql statement and just can't.
My current table has 2 fields:
Value
Name

Then there are a whole bunch of entries:
31 Jon
23 George
3 Bob
4 Jon
9 Jon
98 Bob

What I would like is from my outputed SQL is something like:
23 Geogre 23
43 Jon 66
101 Bob 167

Can anyone help me, this is really confusing for me and need it to work. I am not able to change the table layout in anyway what so ever and only have the 2 fields, Value Name to use.

Please help me

View 14 Replies View Related

Total Sum Of A Measure

Apr 13, 2004

Hi,

for a calculated measure I need the total sum of a measure in different dimension. So for example I want to get in my first dimesion 1500 as my sum and in my second dimension too. Is there a way to get it?
(FirstDimension.CurrentMember.Parent, [Measures].myMeasure) doesn´t work!

Best regards,
Thorsten

View 11 Replies View Related

T-SQL (SS2K8) :: Add Total Row For Each Name

Aug 29, 2015

I have a field in a table which was VERY poorly designed, but that is a matter for another day. Long story short, this field contains, in most instances, where the sale was obtained, the sales man name, and a comment about the sale. A few records have garbage data in the field as the salesman name was not obtained so we want to attribute the info to 'unknown'Is it possible in SQL Server 2008 to write a query that will display the saleinfo for each salesman then a total row under the salesman? Something similar to this

Internet Mark .... statistics here
Phone Mark - applied for credit .... statistics here
Phone Mark - customer referral ..... statistics here
Marks Sales Totals .... statistics here
Next salesman data would go here

but break that down by each salesman and attribute the garbage data like 85623, albaca, racava to salesman 'Unknown'..This is garbage data that should suffice to achieve my desired end result. I know this is unable to occur with a simple select. I even tried a few CTE queries but couldn't get the syntax accurate due to saleinfo basically being a catch all column I was unsure of how to only extrapolate the data I needed

Create Table sales
(
saleid int
,saleinfo varchar(200)
,salestatus varchar(200)
)

Insert Into sales VALUES
(1, 'Phone Mark customer referral', 'Done'), (2, 'Phone Mark customer referral ', 'Done'), (3, 'Phone Mark - applied for credit', 'Holding Pattern')
,(4, 'Internet Mark', 'Done'), (5, 'Internet Mark', 'Holding Pattern'), (6, 'Internet Mark', 'Holding Pattern')
,(7, 'Phone Stan', 'Holding Pattern'), (8, 'Phone Stan', 'Done'), (9, 'Phone Stan', 'Holding Pattern')
,(10, 'Internet Stan - lives to far to drive', 'Done'), (11, 'Internet Stan', 'Done'), (12, 'Phone Vic', 'Done')
,(13, 'Phone Vic', 'Holding Pattern'), (14, '85623', 'Done'), (15, 'albaca', 'Done'), (16, 'racava', 'Done')

View 6 Replies View Related

Total Of Subtotal

Jun 9, 2006

I need to total filtered values each time the filter criteria changes.
So lets say I change the month to JAN then in addition to the subtotals for each category I need to get a Grand Total.
Thanks much.

SELECT Location, SUM(month_est) AS SubTot_Month_Est, SUM(actual) AS SubTot_Actual, mnth, yr
FROM dbo.meetings
GROUP BY Location, mnth, yr

View 3 Replies View Related

Counting And Total

Jun 10, 2006

Hi All

I have:

select prod_id , count(prod_id)[Number of Times]
from orders_tbl
group by prod_id
order by 1;

I get a result however, how do sum up the total number of times ?

Thanks

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved