Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase «««23456»»

Display ALL rows even if no data exists Expand / Collapse
Author
Message
Posted Monday, August 18, 2014 10:00 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Yesterday @ 12:42 PM
Points: 1,669, Visits: 2,221
pwalter83 (8/18/2014)
sgmunson (8/18/2014)
Okay, so now the excuse for not explaining EVERYTHING is that some of the columns aren't in use??? Really? Sorry, but I'm done with this. Every explanation I've seen so far has done little or nothing to make this the slightest bit more clear. This person simply can't be bothered, and seems more interested in leading a chase than actually getting useful answers. I'm simply not willing to help someone that insists on playing this game.


Can you just not reply instead of writing provocatively to discourage others from providing solutions ?



Can you just post what you were asked for repeatedly instead of avoiding it like the plague? I'm absolutely certain it would get better results than what you've provided so far.


Steve
(aka sgmunson)

Internet ATM Machine
Post #1604537
Posted Monday, August 18, 2014 10:23 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Yesterday @ 4:06 AM
Points: 1,917, Visits: 19,596
pwalter83 (8/18/2014)
sgmunson (8/18/2014)
Okay, so now the excuse for not explaining EVERYTHING is that some of the columns aren't in use??? Really? Sorry, but I'm done with this. Every explanation I've seen so far has done little or nothing to make this the slightest bit more clear. This person simply can't be bothered, and seems more interested in leading a chase than actually getting useful answers. I'm simply not willing to help someone that insists on playing this game.


Can you just not reply instead of writing provocatively to discourage others from providing solutions ?



I, for one, would be happy to consider your problem...but from reading thro this thread...I have to agree that DDL and sample data (and the expected results based on your sample data) would help considerably.

so far all I see is DDL for two tables (out of six?) and no sample data or expected results.

I would expect that if you provide what has been requested that your problem can be resolved quickly and with tried and tested code.

kind regards

edit typos


______________________________________________________________
you can lead a user to data....but you cannot make them think
and remember....every day is a school day
Post #1604551
Posted Monday, August 18, 2014 10:28 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 6:03 AM
Points: 6,805, Visits: 14,022
J Livingston SQL (8/18/2014)
pwalter83 (8/18/2014)
sgmunson (8/18/2014)
Okay, so now the excuse for not explaining EVERYTHING is that some of the columns aren't in use??? Really? Sorry, but I'm done with this. Every explanation I've seen so far has done little or nothing to make this the slightest bit more clear. This person simply can't be bothered, and seems more interested in leading a chase than actually getting useful answers. I'm simply not willing to help someone that insists on playing this game.


Can you just not reply instead of writing provocatively to discourage others from providing solutions ?



I, for one, would be happy to consider your problem...but from reading thro this thread...I have to agree that DDL and sample data (and the expected results based on your sample data) would help considerably.

so far all I see is DDL for two tables (out of six?) and no sample data or expected results.

I would expect that if you provide what has been requested that your problem can be resolved quickly and with tried and tested code.

kind regards

edit typos


I'm also still in. Paul, can you please provide INSERTs to populate the two tables with say 30 or 40 rows of data? I think it could go a long way to sorting this out. Cheers.


“Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
Exploring Recursive CTEs by Example Dwain Camps
Post #1604555
Posted Tuesday, August 19, 2014 8:39 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Wednesday, October 15, 2014 1:57 AM
Points: 574, Visits: 1,818

I'm also still in. Paul, can you please provide INSERTs to populate the two tables with say 30 or 40 rows of data? I think it could go a long way to sorting this out. Cheers.


Thank you all for your eagerness to help.

On popular demand , please find the DDL and sample data for all the tables used in the query below. Just a humble request, could you please use the query below as the basis for your code as it returns correct resultset in terms of row counts. I mean I wish to use the functionality of my query but at the same time want to show all the listed countries as shown in the attached screenshot (2 examples) if no data exists.

Thanks a lot.


CREATE TABLE [dbo].[MG_OFFICE](
[OFFICE_CD] [varchar](10) NOT NULL,
[COUNTRY_CD] [varchar](2) NULL)


insert into [MG_OFFICE]
values('KBE ANR', 'BE')
insert into [MG_OFFICE]
values('KBE ZEE', 'BE')
insert into [MG_OFFICE]
values('KEU ANR', 'BE')
insert into [MG_OFFICE]
values('KDE DUS', 'DE')
insert into [MG_OFFICE]
values('KDE BRE', 'DE')
insert into [MG_OFFICE]
values('KDE FRA', 'DE')
insert into [MG_OFFICE]
values('KDE HAM', 'DE')
insert into [MG_OFFICE]
values('ESBLR BCN', 'ES')
insert into [MG_OFFICE]
values('ESBLR MAD', 'ES')
insert into [MG_OFFICE]
values('ESBLR SDR', 'ES')
insert into [MG_OFFICE]
values('ESBLR TAR', 'ES')
insert into [MG_OFFICE]
values('EESCR TLL', 'EE')
insert into [MG_OFFICE]
values('KDE GDY', 'DE')
insert into [MG_OFFICE]
values('KRU LED', 'RU')
insert into [MG_OFFICE]
values('LTLIM KLJ', 'LT')
insert into [MG_OFFICE]
values('KEU RTM', 'NL')
insert into [MG_OFFICE]
values('KNL RTM', 'NL')
insert into [MG_OFFICE]
values('KFR BOD', 'FR')
insert into [MG_OFFICE]
values('KFR DKK', 'FR')
insert into [MG_OFFICE]
values('KFR FOS', 'FR')
insert into [MG_OFFICE]
values('KFR LEH', 'FR')
insert into [MG_OFFICE]
values('KFR LIO', 'FR')
insert into [MG_OFFICE]
values('KSE HES', 'SE')
insert into [MG_OFFICE]
values('KSE-JV GOT', 'SE')
insert into [MG_OFFICE]
values('KSE-JV HES', 'SE')



CREATE TABLE [dbo].[MG_COUNTRY](
[COUNTRY_CD] [varchar](2) NOT NULL,
[COUNTRY_DSC] [varchar](35) NOT NULL
)

insert into [MG_COUNTRY]
values('BE', 'BELGIUM')
insert into [MG_COUNTRY]
values('FR', 'FRANCE')
insert into [MG_COUNTRY]
values('SE', 'SWEDEN')
insert into [MG_COUNTRY]
values('ES', 'SPAIN')
insert into [MG_COUNTRY]
values('NL', 'NETHERLANDS')
insert into [MG_COUNTRY]
values('RU', 'RUSSIA')
insert into [MG_COUNTRY]
values('EE', 'ESTONIA')
insert into [MG_COUNTRY]
values('LT', 'LITHUANIA')


CREATE TABLE [dbo].[MG_BOOKING](
[BOOKING_ID] [numeric](10, 0) NOT NULL,
[BOOKING_NUM] [varchar](15) NULL,
[BOOKING_OFFICE_CD] [varchar](10) NULL,
[BOOKING_STATUS_CD] [char](1) NULL,
[POL_LOCATION_CD] [varchar](5) NULL
)

INSERT INTO [MG_BOOKING]
values('1','A1','KBE ANR','F','BEANR')
INSERT INTO [MG_BOOKING]
values('2','A2','KBE ANR','P','BEANR')
INSERT INTO [MG_BOOKING]
values('3','A3','KBE ZEE','I','BEANR')
INSERT INTO [MG_BOOKING]
values('4','A4','KBE ZEE', 'H','BEANR')
INSERT INTO [MG_BOOKING]
values('5','B1','KDE DUS','F','NLRTM')
INSERT INTO [MG_BOOKING]
values('6','B2','KDE DUS', 'I','NLRTM')
INSERT INTO [MG_BOOKING]
values('7','B3','KBE ZEE','P','NLRTM')
INSERT INTO [MG_BOOKING]
values('8','B4','KDE BRE','F','DEBRV')
INSERT INTO [MG_BOOKING]
values('9','C1','KDE BRE','F','DEBRV')
INSERT INTO [MG_BOOKING]
values('10','C2','KSE HES','H','DEBRV')
INSERT INTO [MG_BOOKING]
values('11','C3','KSE HES','I','DEBRV')
INSERT INTO [MG_BOOKING]
values('12','D4','KFR DKK','P','DEBRV')
INSERT INTO [MG_BOOKING]
values('13','D1','KFR DKK','P','CNTAO')
INSERT INTO [MG_BOOKING]
values('14','D2','LTLIM KLJ','I','SGSIN')
INSERT INTO [MG_BOOKING]
values('15','D3','LTLIM KLJ','I','CNSHA')
INSERT INTO [MG_BOOKING]
values('16','E1','ESBLR BCN','P','ESBCN')
INSERT INTO [MG_BOOKING]
values('17','E2','ESBLR BCN','F','ESBCN')
INSERT INTO [MG_BOOKING]
values('18','E3','EESCR TLL','H','ESBCN')
INSERT INTO [MG_BOOKING]
values('19','E4','ESBLR BCN','P','ESVLC')
INSERT INTO [MG_BOOKING]
values('20','E5','EESCR TLL','I','ESVLC')

CREATE TABLE [dbo].[MG_BOOKING_ITINERARY](
[BOOKING_ID] [numeric](10, 0) NULL,
[VESSEL_CD] [varchar](10) NULL,
[VOYAGE_CD] [varchar](12) NULL
)

INSERT INTO [MG_BOOKING_ITINERARY]
VALUES('1','HSMB','22E')
INSERT INTO [MG_BOOKING_ITINERARY]
VALUES('2','JKB','B071S')
INSERT INTO [MG_BOOKING_ITINERARY]
VALUES('3','CSCEX','005E')
INSERT INTO [MG_BOOKING_ITINERARY]
VALUES('4','GDGB','052E')
INSERT INTO [MG_BOOKING_ITINERARY]
VALUES('5','HJSP','0009E')
INSERT INTO [MG_BOOKING_ITINERARY]
VALUES('6','CSCEX','005E')
INSERT INTO [MG_BOOKING_ITINERARY]
VALUES('7','HNJEUR','0005E')
INSERT INTO [MG_BOOKING_ITINERARY]
VALUES('8','STPAO','016W')
INSERT INTO [MG_BOOKING_ITINERARY]
VALUES('9','HPHO','121W')
INSERT INTO [MG_BOOKING_ITINERARY]
VALUES('10','HPHO','122W')
INSERT INTO [MG_BOOKING_ITINERARY]
VALUES('11','HPHO','121W')
INSERT INTO [MG_BOOKING_ITINERARY]
VALUES('12','CSNGY','034W')
INSERT INTO [MG_BOOKING_ITINERARY]
VALUES('13','COSPRD','009W')
INSERT INTO [MG_BOOKING_ITINERARY]
VALUES('14','COSPRD','009W')
INSERT INTO [MG_BOOKING_ITINERARY]
VALUES('15','HMBB','038W')
INSERT INTO [MG_BOOKING_ITINERARY]
VALUES('16','HMBB','038W')
INSERT INTO [MG_BOOKING_ITINERARY]
VALUES('17','HKGB','021E')
INSERT INTO [MG_BOOKING_ITINERARY]
VALUES('18','HKGB','021E')
INSERT INTO [MG_BOOKING_ITINERARY]
VALUES('19','YMUPSU','001E')
INSERT INTO [MG_BOOKING_ITINERARY]
VALUES('20','YMUPSU','001E')


CREATE TABLE [dbo].[MG_BOOKING_EQUIPMENT_REQ_DETAIL](
[EQUIPMENT_TYPE_CD] [varchar](5) NULL,
[BOOKING_ID] [numeric](10, 0) NOT NULL
)

insert into [MG_BOOKING_EQUIPMENT_REQ_DETAIL]
values('20T86','1')
insert into [MG_BOOKING_EQUIPMENT_REQ_DETAIL]
values('40D96','2')
insert into [MG_BOOKING_EQUIPMENT_REQ_DETAIL]
values('20T86','3')
insert into [MG_BOOKING_EQUIPMENT_REQ_DETAIL]
values('40D96','4')
insert into [MG_BOOKING_EQUIPMENT_REQ_DETAIL]
values('20T86','5')
insert into [MG_BOOKING_EQUIPMENT_REQ_DETAIL]
values('40D96','6')
insert into [MG_BOOKING_EQUIPMENT_REQ_DETAIL]
values('40D96','7')
insert into [MG_BOOKING_EQUIPMENT_REQ_DETAIL]
values('45T96','8')
insert into [MG_BOOKING_EQUIPMENT_REQ_DETAIL]
values('40W96','9')
insert into [MG_BOOKING_EQUIPMENT_REQ_DETAIL]
values('45Y96','10')
insert into [MG_BOOKING_EQUIPMENT_REQ_DETAIL]
values('20W96','11')
insert into [MG_BOOKING_EQUIPMENT_REQ_DETAIL]
values('20W96','12')
insert into [MG_BOOKING_EQUIPMENT_REQ_DETAIL]
values('40W96','13')
insert into [MG_BOOKING_EQUIPMENT_REQ_DETAIL]
values('20W96','14')
insert into [MG_BOOKING_EQUIPMENT_REQ_DETAIL]
values('20W96','15')
insert into [MG_BOOKING_EQUIPMENT_REQ_DETAIL]
values('45W96','16')
insert into [MG_BOOKING_EQUIPMENT_REQ_DETAIL]
values('40W96','17')
insert into [MG_BOOKING_EQUIPMENT_REQ_DETAIL]
values('20W96','18')
insert into [MG_BOOKING_EQUIPMENT_REQ_DETAIL]
values('40W96','19')
insert into [MG_BOOKING_EQUIPMENT_REQ_DETAIL]
values('20W96','20')




CREATE TABLE [dbo].[MG_CONTAINER_CODE](
[CONTAINER_CD] [varchar](5) NOT NULL,
[TYPE_CD] [varchar](3) NOT NULL
)

INSERT INTO [MG_CONTAINER_CODE]
VALUES('20W96','DRY')
INSERT INTO [MG_CONTAINER_CODE]
VALUES('40W96','RFR')
INSERT INTO [MG_CONTAINER_CODE]
VALUES('45T96','RFR')
INSERT INTO [MG_CONTAINER_CODE]
VALUES('40D96','RFR')
INSERT INTO [MG_CONTAINER_CODE]
VALUES('20T86','DRY')

SELECT   booking_num,  CASE 
WHEN mo.OFFICE_CD IN ('KBE ANR','KBE ZEE', 'KEU ANR') THEN 'BELGIUM'
WHEN mo.OFFICE_CD IN ('KDE VIE') THEN 'AUSTRIA'
WHEN mo.OFFICE_CD IN ('KDE BRE', 'KDE BRV', 'KDE DUS', 'KDE FRA', 'KDE HAM', 'KDE MUC', 'KDE STR') THEN 'GERMANY'
WHEN mo.OFFICE_CD IN ('KFR BOD','KFR DKK','KFR FOS','KFR LEH','KFR LIO','KFR MRS','KFR PAR','EXAF PARIS','FRBAL BOD','KEU LEH') THEN 'FRANCE'
WHEN mo.OFFICE_CD IN ('KEU RTM', 'KNL RTM') THEN 'NETHERLANDS'
WHEN mo.OFFICE_CD IN ('KDE PRG') THEN 'CZECH REPUBLIC'
WHEN mo.OFFICE_CD IN ('CHGLS BSL') THEN 'SWITZERLAND'
WHEN mo.OFFICE_CD IN ('KPT LIS','KPT OPO') THEN 'PORTUGAL'
WHEN mo.OFFICE_CD IN ('ESBLR BCN','ESBLR MAD','ESBLR SDR','ESBLR TAR','ESBLR VCL','ESBLR VGO','ESBLR VLC','KES BCN','KES BIO','KES MAD','KES VGO','KES VLC') THEN 'SPAIN'
WHEN mo.OFFICE_CD IN ('IEIRL DUB','IEIRL ORK') THEN 'IRELAND'
WHEN mo.OFFICE_CD IN ('KSE HES','KSE-JV GOT','KSE-JV HES') THEN 'SWEDEN'
WHEN mo.OFFICE_CD IN ('KFI HEL') THEN 'FINLAND'
WHEN mo.OFFICE_CD IN ('KDK AAL','KDK AAR','KDK CPH','KDK EBJ','KDK ODE','KDK-JV AAL','KDK-JV AAR','KDK-JV CPH','KDK-JV EBJ','KDK-JV ODE') THEN 'DENMARK'
WHEN mo.OFFICE_CD IN ('KNO OSL','KNO-JV OSL') THEN 'NORWAY'
WHEN mo.OFFICE_CD IN ('KDE GDY', 'EESCR TLL', 'KRU LED', 'LTLIM KLJ', 'LVKLS RIX', 'RUMET LED', 'RUMET MOW', 'RUMSA LED') THEN 'BALTIC' ELSE 'BUFFER' END AS COUNTRY_DSC,

CASE WHEN POL_LOCATION_CD IN ('DKAAR', 'DKCPH', 'FIHEL','FIKTK', 'IEORK', 'IEDUB', 'NLRTM', 'PTLEI', 'PTOPO', 'PTLIS', 'ESBIO', 'ESVGO', 'SEGOT', 'SEHEL', 'GBBEL') THEN 'NLRTM' WHEN POL_LOCATION_CD IN ('DKFRC',
'FIRAU', 'FIOUL', 'DEBRV', 'NOAES', 'NOBGO', 'NOFRK', 'NOHAL', 'NOHAU', 'NOKRS', 'NOKSU', 'NOLAR', 'NOMSS', 'NOOSL', 'NOTAE', 'PLGDY', 'SEGVX', 'SEMMA',
'SENRK', 'SESTO', 'DEHAM') THEN 'DEBRV' WHEN POL_LOCATION_CD = 'BEANR' THEN 'BEANR' WHEN POL_LOCATION_CD = 'FRLEH' THEN 'FRLEH' ELSE POL_LOCATION_CD END AS POL_LOCATION_CD,
CASE WHEN ber.EQUIPMENT_TYPE_CD LIKE '20%' THEN 1 ELSE 2 END AS TEU, mcc.TYPE_CD, mbi.VESSEL_CD, mbi.VOYAGE_CD

FROM MG_COUNTRY AS mc


right JOIN MG_OFFICE AS mo ON mc.COUNTRY_CD = mo.COUNTRY_CD
left join MG_BOOKING mgd on mgd.BOOKING_OFFICE_CD = mo.OFFICE_CD

left JOIN MG_BOOKING_EQUIPMENT_REQ_DETAIL AS ber ON mgd.BOOKING_ID = ber.BOOKING_ID

right JOIN MG_BOOKING_ITINERARY AS mbi ON

mgd.BOOKING_ID = mbi.BOOKING_ID


JOIN MG_CONTAINER_CODE AS mcc ON ber.EQUIPMENT_TYPE_CD = mcc.CONTAINER_CD

AND mgd.BOOKING_STATUS_CD IN ('H', 'F', 'I', 'P')



WHERE mbi.VESSEL_CD IN (@vessel) AND mbi.VOYAGE_CD IN (@voyage)
ORDER BY COUNTRY_DSC



  Post Attachments 
Screenshot.png (5 views, 27.99 KB)
Post #1604963
Posted Tuesday, August 19, 2014 9:03 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Yesterday @ 12:42 PM
Points: 1,669, Visits: 2,221
Just a quick FYI to make everyone aware that the posted query doesn't work with the posted table inserts, and that you'll need to add a right paren to one of the table create statements as it's missing in the posted code. The query is looking for mgd.BOOKING_OFFICE_CD, and that table does not contain such a field, nor do any of the other tables. Note also that the OP has STILL NOT EXPLAINED the relevance of the individual tables to the desired result. Thus the posted code, for all practical purposes, is useless.

Some might complain that I had bowed out on this post, so why am I still responding? Simple, really... Between the arrogance of the OP posting the words "On popular demand", as if to indicate they had no intention of posting what was requested, and only did so when pushed into it; and the subsequent failure of the OP to even post usable code. I have to wonder if the OP is even qualified to perform the work at all...

That kind of disrespect in a post is not particularly excusable, and I'm not going to help this poster continue to waste anyone's time any further.


Steve
(aka sgmunson)

Internet ATM Machine
Post #1604977
Posted Tuesday, August 19, 2014 9:12 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Wednesday, October 15, 2014 1:57 AM
Points: 574, Visits: 1,818
sgmunson (8/19/2014)
Just a quick FYI to make everyone aware that the posted query doesn't work with the posted table inserts, and that you'll need to add a right paren to one of the table create statements as it's missing in the posted code. The query is looking for mgd.BOOKING_OFFICE_CD, and that table does not contain such a field, nor do any of the other tables. Note also that the OP has STILL NOT EXPLAINED the relevance of the individual tables to the desired result. Thus the posted code, for all practical purposes, is useless.

Some might complain that I had bowed out on this post, so why am I still responding? Simple, really... Between the arrogance of the OP posting the words "On popular demand", as if to indicate they had no intention of posting what was requested, and only did so when pushed into it; and the subsequent failure of the OP to even post usable code. I have to wonder if the OP is even qualified to perform the work at all...

That kind of disrespect in a post is not particularly excusable, and I'm not going to help this poster continue to waste anyone's time any further.


If you can see properly, I posted a smiley next to 'On popular demand' as it was intended to be in humour.

Just to make you aware, I reported you yesterday for your provocative post and I am going to report you now again for the similar thing you have done now.

You just CANNOT force members to not reply to a post.

Hope you get banned soon.
Post #1604986
Posted Tuesday, August 19, 2014 9:30 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Yesterday @ 12:42 PM
Points: 1,669, Visits: 2,221
I'm pretty sure I can't force anyone to do anything. I don't need to. Clearly, you'd rather complain than actually solve your problem. You need to realize that when you are getting free assistance, biting the hand that feeds you is a bad idea. Continually avoiding providing any useful information is also a pretty good way to stop getting help. I'm pretty sure any lack of assistance coming from other members will be appropriately proportional to your lack of respect for the value of the time of those providing such assistance.


Steve
(aka sgmunson)

Internet ATM Machine
Post #1604995
Posted Tuesday, August 19, 2014 9:36 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Wednesday, October 15, 2014 1:57 AM
Points: 574, Visits: 1,818
sgmunson (8/19/2014)
I'm pretty sure I can't force anyone to do anything. I don't need to. Clearly, you'd rather complain than actually solve your problem. You need to realize that when you are getting free assistance, biting the hand that feeds you is a bad idea. Continually avoiding providing any useful information is also a pretty good way to stop getting help. I'm pretty sure any lack of assistance coming from other members will be appropriately proportional to your lack of respect for the value of the time of those providing such assistance.


I am not asking for your assistance anymore so stop replying. You have done enough damage now.
Post #1604999
Posted Wednesday, August 20, 2014 1:45 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 6:03 AM
Points: 6,805, Visits: 14,022
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.

“Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
Exploring Recursive CTEs by Example Dwain Camps
Post #1605311
Posted Monday, August 25, 2014 7:19 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Wednesday, October 15, 2014 1:57 AM
Points: 574, Visits: 1,818
ChrisM@Work (8/20/2014)
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.

Hi Chris,

The sample script is working okay with the SQL query. could you please give some suggestion if you have some time.

Thanks.
Post #1607059
« Prev Topic | Next Topic »

Add to briefcase «««23456»»

Permissions Expand / Collapse