Viewing 15 posts - 3,016 through 3,030 (of 10,144 total)
CREATE TABLE #CUSTOMERS (CustomerID INT,CustomerName VARCHAR(20))
INSERT INTO #CUSTOMERS (CustomerID,CustomerName) VALUES
(100001,'Mr J Bloggs'),
(100002,'Mr J Smith')
CREATE TABLE #POLICIES (PolicyID INT,PolicyTypeID INT,CustomerID INT)
INSERT INTO #POLICIES (PolicyID,PolicyTypeID,CustomerID) VALUES
(100001,100001,100001),
(100002,100002,100001),
(100003,100003,100001),
(100004,100001,100002),
(100005,100002,100002)
CREATE TABLE #POLICYTYPES (PolicyTypeID INT,PolTypeName VARCHAR(20),ProviderID...
August 22, 2014 at 4:46 am
Here are several suggestions -
--SELECT @From = COALESCE(@From, Min(QuotationDate)),
-- @To = COALESCE(@To , Max(QuotationDate))
--FROM dbo.Quotation;
--DECLARE @F_Loc DateTime = @From,...
August 22, 2014 at 2:29 am
Here's something I wrote some time ago (inspired by something Jack Corbett wrote years ago) which explains why you have two joins followed by two ON clauses:
The order of tables...
August 22, 2014 at 1:52 am
ScottPletcher (8/21/2014)
August 22, 2014 at 1:41 am
-------------------------------------------------------------------------
-- Your first query has lots of scope for simplification:
-------------------------------------------------------------------------
SELECT 0 AS SIRA
,TBLCARI.IND
,(
SELECT SUM(BORC - ALACAK)
FROM F0102D0001TBLCARIHAREKETLERI AS CARHAR
WHERE CARHAR.FIRMANO = TBLCARI.IND
) AS BAKIYE
,TCG.ISLEMIND
,TBLCARI.SOYADI
,TBLCARI.ADI
,TBLCARI.SOYADI + ' ' + TBLCARI.ADI AS...
August 21, 2014 at 9:34 am
Speaking of bronze-age development, this is one of the very few threads I can post to. Attempting to reply to other threads (which look kinda "flat") raises an error. In...
August 21, 2014 at 6:44 am
jrusso (8/20/2014)
I figured out a way to do it. Thank you
Does it look something like this?
SELECT
[AmountGiven] = ISNULL(SUM(a.AmountGiven), 0),
a.YearToDate,
a.EndDate
FROM ( -- a
SELECT
[AmountGiven] = MAX(x.[AmountGiven]),
[EndDate] = MAX(y.[EndDate]),
YearToDate...
August 21, 2014 at 2:21 am
You're welcome.
Try this:
DROP TABLE #TEMP
CREATE TABLE #TEMP (PlayerName varchar(20),DismissFormat varchar(20),StrickRate int,CreatedDate date)
INSERT INTO #TEMP VALUES ('ABC','Catch Out',100,'2014-01-12') --Date is in YYYY/MM/DD format
INSERT INTO #TEMP VALUES ('ABC','Hit Wicket',50,'2014-01-13')
INSERT INTO #TEMP VALUES...
August 20, 2014 at 6:35 am
Paul, if you wouldn't mind running through your sample script and correcting the errors which Steve kindly pointed out, I'll take a look later today.
August 20, 2014 at 1:45 am
TomThomson (8/19/2014)
...that my wife hid (or, in wife-ese, "tidied up") ...
Gaaah! Don't get me started. Every time I start work on a job in the extension, all my tools are...
August 20, 2014 at 1:43 am
J Livingston SQL (8/18/2014)
pwalter83 (8/18/2014)
sgmunson (8/18/2014)
August 18, 2014 at 10:28 am
It looks like you are trying to run through sys.tables or whatever and do something to each table encountered, although as Gail points out, it's bl00dy hard to tell from...
August 18, 2014 at 6:32 am
I know what you are attempting to do here and it wouldn't take long with access to your tables, however scripts for all of the tables along with sample data...
August 18, 2014 at 6:24 am
Hi Paul
Can you provide the following please?
CREATE TABLE for MG_COUNTRY with INSERTs to populate a few sample rows
Do you wish to include every row from this table in the report?...
August 18, 2014 at 3:07 am
SELECT
[Id Number],
[Family Name],
[Given Name],
Title,
[Timesheet Date] = MAX([Timesheet Date]),
[Start Date],
[End Date]
FROM YourVacationTable
WHERE [Start Date] <= @EndDate
AND [End Date] >= @StartDate
GROUP BY [Id Number],[Family Name],[Given Name],Title,[Start Date],[End Date]
August 15, 2014 at 7:03 am
Viewing 15 posts - 3,016 through 3,030 (of 10,144 total)