Viewing 15 posts - 1,306 through 1,320 (of 2,007 total)
Fixed your sample data so that it actually works -
CREATE TABLE [dbo].[Devices](
[ID] [int] NOT NULL,
[DeviceName] [varchar](50) NOT NULL,
[DeviceType] [varchar](20) NOT NULL,
[Description] [varchar](255) NULL,
CONSTRAINT [PK_Devices] PRIMARY KEY CLUSTERED ([ID] ASC)
)
CREATE...
November 22, 2011 at 7:44 am
No problem. Hell, if you're really lucky then one of the others that knows a bit more about PIVOT will happen by with a better solution 😀
November 22, 2011 at 6:51 am
Formatted for sanity!!
SELECT DATEADD([hour], DATEDIFF([hour], 0, SCAN_ASSEMBLED_DATE), 0) AS DATETY,
COUNT(PROD_ASSEMBLY_BARCODES.MATERIAL_ID) AS QTY, '***' AS TYPE,
CASE WHEN [STK_PRODUCTION_LINE] = 'F'
THEN 'N'
WHEN...
November 22, 2011 at 6:30 am
squidder11 (11/22/2011)
This is what I have so far, how do I get more than one row of data in the results
BEGIN TRAN
SET NOCOUNT ON
CREATE TABLE #TemplateDictionary(
[TMPL_OBJECT_NAME] [nvarchar](100) NOT NULL,
[FieldName] [nvarchar](100)...
November 22, 2011 at 6:26 am
Yeah, no-one is going to download a zip file on a programming website 😉
Attach them as text files
November 22, 2011 at 4:35 am
squidder11 (11/22/2011)
The problem I have is that No. of rows...
November 22, 2011 at 3:46 am
BinaryDigit (11/22/2011)
I have a query that looks like this
declare @temp table(Lat smallint, Long smallint, vesselCount int)
INSERT INTO @temp
SELECT Latitude, Longitude, dbo.GetZoneBlockCount(Latitude, Longitude)
FROM ZoneBlocks WITH (NOLOCK)
UPDATE ZoneBlocks
SET VesselCount =...
November 22, 2011 at 3:41 am
Probably should have just asked Steve to move the original (when he gets back) if you thought it was better suited here.
November 22, 2011 at 3:28 am
This is probably not the best way to go about it, I'm not good with PIVOT/UNPIVOT because I feel that this sort of job is better done in the presentation...
November 22, 2011 at 3:25 am
Ninja's_RGR'us (11/21/2011)
... does that include learning material and time??Didn't think so :-D.
Of course not! 🙂
Ninja's_RGR'us (11/21/2011)
November 21, 2011 at 6:55 am
Dev (11/21/2011)
Ninja's_RGR'us (11/21/2011)
Dev (11/21/2011)
The only certif I give any credit to is MCM or MCA if it ever becomes available to the public (sorry if I'm...
November 21, 2011 at 6:49 am
Ninja's_RGR'us (11/21/2011)
@cadavreWhat about week-ends, holidays and non-production days?
You don't realllllllllly want to work 365 days / year, do you? 😉
I did write "Your question is flawed".
Either way,...
November 21, 2011 at 5:24 am
steve-433846 (11/21/2011)
quite easy when the sickness is just in one month, can anyone...
November 21, 2011 at 5:20 am
This gives you 82,138 dates and is correct for leap-years.
IF object_id('tempdb..#testBillingPeriods') IS NOT NULL
BEGIN
DROP TABLE #testBillingPeriods
END
SELECT IDENTITY(INT,1,1) AS ID,
startFirstMonth, startMidMonth, finishMidMonth, finishEndMonth
INTO #testBillingPeriods
FROM (SELECT TOP...
November 21, 2011 at 4:29 am
Please don't use a CURSOR.
I'm not particularly good with PIVOT, mainly because I think that pivoting of data should occur in the presentation layer rather than the database. So...
November 21, 2011 at 4:04 am
Viewing 15 posts - 1,306 through 1,320 (of 2,007 total)