Viewing 15 posts - 31 through 45 (of 94 total)
I finally managed to resolve the required format issue.
I built two tables one for the headers row VCR\CCR and one for lines BTP\CTD. If you are interested they were...
January 11, 2017 at 10:16 pm
Apologies for the bad format, attached is the DDL & DML Statements.
January 11, 2017 at 6:32 pm
Insert statements;
INSERT INTO [dbo].[VehicleAnalysisVCR]
([VCRRecType]
,[VCRCustNo]
...
January 10, 2017 at 3:23 pm
I have made a header table called [VehicleAnalysis_Header] which holds the VCR\CCR records with unique primary key.
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[VehicleAnalysis_Header](
[Head_ID] [int] IDENTITY(1,1) NOT NULL,
[VCRRecType] [varchar](3) NULL,
[VCRCustNo]...
January 5, 2017 at 10:16 pm
DDL is below and some sample data is attached, the required format is pipe delimited | | | | etc...
CREATE TABLE [dbo].[VehicleAnalysisVCR](
[VCRRecType] [varchar](3) NULL,
[VCRCustNo] [int] NULL,
[VCRCostCentre] [varchar](max) NULL,
[VCRCollationFlag] [varchar](2) NULL,
[VCRPrintFlag]...
January 5, 2017 at 2:54 pm
I found and fixed the problem in the CTE's I added more joins and this removed the No Join Predicate, thanks for the replies.
January 4, 2017 at 3:06 pm
something like this;
Select
SUM (CASE WHEN DATEPART(m, [FuelTranDate]) = DATEPART(m,GETDATE()) THEN LastOdo ELSE '' END)
- SUM(CASE WHEN DATEPART(m, [FuelTranDate]) = DATEPART(m, DATEADD(m, -1, GETDATE())) THEN Lastodo ELSE ''...
November 24, 2016 at 7:56 pm
Thanks a lot for the replies. Not sure why it didn't work the first time when I had @SaleID as the output.
September 20, 2016 at 11:05 pm
Thanks for the replies.
None of these work and the @@rowcount is also only returning '1'
,SUM([>7 Days]) OVER(PARTITION BY f.Country ,f.CompanyName ,f.InvoiceID ,f.SupplierCode ,f.InvoiceNumber
,f.[Scan Date] ,f.[Approval Date]...
July 5, 2016 at 6:26 pm
I added a primary key to the AUD currency table and tried this. it returns the same as the cursor, multiple emtpy sets, can anyone detail what is wrong.
DECLARE...
May 19, 2016 at 9:36 pm
Yeah I just created a rate table, dbo.aus for the first set. trying to make it more dynamic so the rates can be updated and automatically and if there's match...
May 19, 2016 at 1:06 am
Thanks Orlando and Alan for the replies.
Is dbo.splitcsv a reserved table or function somewhere as i am unable to find it within the DB?
March 23, 2016 at 8:27 pm
I resolved it using the code below, you cant use the derived column replace function and datepart, so i had to make it as a new column and in a...
February 22, 2016 at 9:54 pm
Orlando Colamatteo (1/27/2016)
Or are you looking to copy data from an XML column in one server...
January 27, 2016 at 9:13 pm
The end result i am trying to achieve is to export the XML into another table or tables depending on the data structure, then write some reports via SSRS.
select Col1...
January 27, 2016 at 9:02 pm
Viewing 15 posts - 31 through 45 (of 94 total)