Viewing 15 posts - 3,136 through 3,150 (of 10,144 total)
-- Next I've commented out the join to Legacy L2.
-- It appears to be redundant for this purpose, but
-- will add to the cost of running the query, i.e. how...
July 17, 2014 at 5:57 am
pilla.sree85 (7/17/2014)
...what should i do next??
Remember what you've observed and give yourself some credit for learning it. Next:
-- Having corrected the filter 'HAVING COUNT(*) > 1',
-- change the table joins...
July 17, 2014 at 5:40 am
pilla.sree85 (7/17/2014)
yes need to fix the baove query
-- This is the BASELINE QUERY. It's your starting point.
-- I've formatted it and added a new column [RowType] to help you to...
July 17, 2014 at 5:11 am
pilla.sree85 (7/17/2014)
where L1.ReceivedFileID = ReceivedFiles.ReceivedFileID
and L1.AcctNo=L2.AcctNo
and L1.MarketCode NOT IN (SELECT MarketCode from Markets where (AllowDupes = '1' OR UPPER(AllowDupes) = 'Y' ))
group by...
July 17, 2014 at 4:50 am
SELECT
L1.AcctNo,
L1.ReceivedFileID
FROM Legacy_crfcard L1
-- Why this? If you have any dupes, it will double the number of rows output.
-- That's ALL it will do - slow...
July 17, 2014 at 4:08 am
pilla.sree85 (7/17/2014)
IF EXISTS(
SELECT L1.AcctNo,L1.ReceivedFileID from...
July 17, 2014 at 3:57 am
pilla.sree85 (7/17/2014)
SELECT COUNT(*) -- count the dupesets
FROM (
SELECT n = 1 -- i dont understand this statement
FROM...
July 17, 2014 at 1:55 am
Luis Cazares (7/16/2014)
ChrisM@Work (7/16/2014)
The ISDATE is for NULL checking...You're right, I didn't see the DDL before I posted.
However, this puzzles me:
[Store_Opens_Baseline] [nvarchar](255) NULL,
Me too, and it will probably...
July 16, 2014 at 9:51 am
The ISDATE is for NULL checking...
SELECT
f.Brand,
COUNT(recID),
p.Period,
p.Quarter,
p.Year
FROM forecast_data f
LEFT OUTER JOIN Periods p
ON COALESCE(f.Store_Opens_Actual, f.Store_Opens_Forecast, f.Store_Opens_Baseline) BETWEEN p.PeriodStarts AND p.PeriodEnds
--(CASE
--WHEN ISDATE(f.Store_Opens_Actual) = 1 THEN...
July 16, 2014 at 9:45 am
SELECT @_Stat_Count = COUNT(*) -- count the dupesets
FROM (
SELECT n = 1 -- any output will do here: a row corresponds to a dupeset
FROM Legacy L1
INNER JOIN Legacy L2
ON...
July 16, 2014 at 9:18 am
Please post the ddl for the tables 'actual sales data', 'projected sales data' and 'periods', along with INSERT scripts to populate them with data.
July 16, 2014 at 9:09 am
SQLSteve (7/14/2014)
2 excels attached. As is is how it stands now (obviously sensitive data removed)
We just need each supplier code to have 1 entry, not multiple.
All of...
July 14, 2014 at 9:10 am
Here's your query with table aliases applied for readability:
SELECT DISTINCT
ms.SUPPLIER_ACCOUNT,
ms.SUPPLIER_NAME,
ms.ADDRESS1,
ms.ADDRESS2,
ms.ADDRESS3,
ms.ADDRESS4,
ms.ADDRESS5,
ms.ADDRESS6,
ms.POSTCODE,
ms.PAYMENT_TERM,
mb.BANK_SORT_CODE,
mb.BANK_ACCOUNT_NUM,
mb.BANK_REFERENCE,
cd.InvDate
FROM MAGINUS_SUPPLIER ms
INNER JOIN MAGINUS_BANK_DETAILS mb
ON...
July 14, 2014 at 7:08 am
pilla.sree85 (7/11/2014)
sql server 2005
SELECT *
FROM data_table
WHERE CREAT_TM >= @CreatedDate
AND CREAT_TM < DATEADD(DAY,1,@CreatedDate)
July 11, 2014 at 5:08 am
pilla.sree85 (7/11/2014)
select * from data_table where cast(CREAT_TM as DATE) = '2012-07-01'
i am getting error as
Type DATE is not a...
July 11, 2014 at 4:43 am
Viewing 15 posts - 3,136 through 3,150 (of 10,144 total)