Tuesday, July 2, 2013

[SQL Server] a

[SQL Server] a


a

Posted: 02 Jul 2013 03:49 AM PDT

a

Configuration Manager; nothing under SQL Server Services

Posted: 01 Jul 2013 09:58 PM PDT

Honestly, I give up. I can't connect to this database as sa ('a network-related or instance-specific error occurred error 40 [etc.]') so I open up Configuration Manager, click on SQL Server Services, and... it's completely empty (see attached). Why would this happen?I'm connecting via remote desktop, and I'm an administrator on that machine (Windows Server 2008 R2). I've tried Google. The SQL Server service must be up and running because people are using that database right now.As before if you've read any of my posts, I'm fairly new here, everybody else has left and I know nothing about how this machine was set up. This job sucks. Any pointers would be gratefully received! Thanks.

How to compate cross column values

Posted: 02 Jul 2013 12:12 AM PDT

Hi,I am having requirement for to check cross column values,Below is the example tablecol1 col2 col3 col41 2 1/7/2013 5/7/20131 2 8/7/2013 9/7/20131 2 9/7/2013 10/7/20131 2 11/7/2013 12/7/2013Out put should be as belowcol1 col2 col3 col4 OutPut1 2 1/7/2013 5/7/2013 01 2 8/7/2013 9/7/2013 01 2 9/7/2013 10/7/2013 11 2 11/7/2013 12/7/2013 0Where two cross date matches there should be 1 else 0so please help me..

Filtering on SQL Views

Posted: 01 Jul 2013 07:34 PM PDT

Hi AllLooking for a little help.I have a crystal report that is based on a View on my SQL Server (VwQPPMaterialRptPart3).This view is based on a union of 2 other views (VwQPPMaterialRptPart1 & VwQPPMaterialRptPart2). After playing with my Crystal Report Select parameters I cannot get it to filter down the way I need the report to be. As a test I filtered some of the information on the underlying Views (Part1 and Part2) and the report worked perfectly. Is there a way to pass parameters from Crystal Reports to my underlying views? Also because of all my views the report does take an age to load.I am very basic in SQL I can create databases, setup security, add and populate tables and create basic views. So I think my views are very inefficient. Please find below the SQL for my 3 views.VwQPPMaterialRptPart1 (This combines 2 tables, Shift and SAPMaterials)[code="sql"]SELECT TOP (100) PERCENT dbo.SAPMaterials.Material, dbo.Shift.ShiftDepartment, REPLACE(REPLACE(dbo.Shift.ShiftMachine, CHAR(13), ''), CHAR(10), '') AS QPPMachine, dbo.Shift.ShiftAmount, CONVERT(datetime, LEFT(dbo.Shift.ShiftStart, 10), 103) AS Date, dbo.SAPMaterials.MaterialButton, dbo.SAPMaterials.OperationFROM dbo.Shift INNER JOIN dbo.SAPMaterials ON dbo.Shift.ShiftDepartment = dbo.SAPMaterials.Department AND REPLACE(REPLACE(dbo.Shift.ShiftMachine, CHAR(13), ''), CHAR(10), '') = dbo.SAPMaterials.ProcessORDER BY dbo.SAPMaterials.Material[/code]VwQPPMaterialRptPart2 [code="sql"]SELECT TOP (100) PERCENT ShiftDepartment, REPLACE(REPLACE(ShiftMachine, CHAR(13), ''), CHAR(10), '') AS ShiftMachine, MIN(ShiftAmount) AS ShiftAmounts, SUM(Amount) AS Defects, CONVERT(datetime, LEFT(ShiftStart, 10), 103) AS Date, ClassType, MaterialFROM dbo.VwWeeklyPerformanceGROUP BY ShiftDepartment, REPLACE(REPLACE(ShiftMachine, CHAR(13), ''), CHAR(10), ''), CONVERT(datetime, LEFT(ShiftStart, 10), 103), ClassType, MaterialORDER BY ShiftDepartment[/code]VwQPPMaterialRptPart3 - Final Report View[code="sql"]SELECT dbo.VwQPPMaterialRptPart1.Material, dbo.VwQPPMaterialRptPart1.ShiftDepartment, dbo.VwQPPMaterialRptPart1.QPPMachine, dbo.VwQPPMaterialRptPart1.ShiftAmount, CASE WHEN dbo.VwQPPMaterialRptPart2.Defects IS NULL THEN 0 ELSE dbo.VwQPPMaterialRptPart2.Defects END AS Defects, dbo.VwQPPMaterialRptPart1.MaterialButton, dbo.VwQPPMaterialRptPart1.Operation, dbo.VwQPPMaterialRptPart1.DateFROM dbo.VwQPPMaterialRptPart1 LEFT OUTER JOIN dbo.VwQPPMaterialRptPart2 ON dbo.VwQPPMaterialRptPart1.MaterialButton = dbo.VwQPPMaterialRptPart2.Material AND dbo.VwQPPMaterialRptPart1.QPPMachine = dbo.VwQPPMaterialRptPart2.ShiftMachineGROUP BY dbo.VwQPPMaterialRptPart1.Material, dbo.VwQPPMaterialRptPart1.ShiftDepartment, dbo.VwQPPMaterialRptPart1.QPPMachine, dbo.VwQPPMaterialRptPart1.ShiftAmount, dbo.VwQPPMaterialRptPart1.MaterialButton, dbo.VwQPPMaterialRptPart1.Operation, CASE WHEN dbo.VwQPPMaterialRptPart2.Defects IS NULL THEN 0 ELSE dbo.VwQPPMaterialRptPart2.Defects END, dbo.VwQPPMaterialRptPart1.Date[/code]Now the filtering I was using was by ShiftDepartment and Date on my report but the information is not right. I need to filter by ShiftDepartment and Date on Part1 and also filter by SiftDepartment and Date on Part2.Hope you can help sort my mess out.CheersDj

No comments:

Post a Comment

Search This Blog