Put 2 relevant records in a single row
<p>Hello everybody,</p><p>I have a Attendance table, which has columns WorkDate. Schedule_IN_Time, Schedule_OUT_Time, Login_IN_Time, Login_IN_Time, Login_Type.</p><p>Now for every Login_Type = "I" or "O" there are two records. That means for a day say 07/10/2006 as Workdate there are two records like,</p><p>EmpID WorkDate Schedule_IN_Time Schedule_OUT_Time Login_IN_Time Login_OUT_Time Login_Type</p><p>1 07/10/2006 09:00 17:00 9:00 I</p><p>1 07/10/2006 09:00 17:00 17:15 O</p><p>NOW.. I want a report in Crystal report which will have a single record for a single Workdate..as folllows</p><p>EmpID WorkDate Schedule_IN_Time Schedule_OUT_Time Login_IN_Time Login_OUT_Time</p><p>1 07/10/2006 09:00 17:00 9:00 17:15 </p><p>Can you please help me out..I'm usng CrystalReport XI.</p><p>Thanks in advance.</p><p>sauren </p>
Once you group on these put summaries for Max on each of the values you want to display as one line.  Put them in the footer and suppress the details. That should give the desired results.
    - Kathryn Webster (Report Design Consultant)
          Kat's News: http://diamond.businessobjects.com/blog/279
Similar Messages
-
How to display the vertical coloumns(records) in a single row?
Hi all,
I need a requirement in SAP where in the internal table records are in vertical placement as follows:
1 2 3 4 5 | a1 b1 c1 d1 e1
1 2 3 4 5 | a2 b2 c2 d2 e2
1 2 3 4 5 | a3 b3 c3 d3 e3
and so on..........
now as per the requirement I need all the records to be displayed in a single row in the output as follows:
1 2 3 4 5 | a1 b1 c1 d1 e1 | a2 b2 c2 d2 e2 | a3 b3 c3 d3 e3 |.....so on
Any pointers on this would be of great help.
thanks in advance,
Vamsee.Loop at itab.
at new f1.
write : itab-f1. <--- here don't give '/' .. which will write in new line ...
endif.
write : itab-f2, <--- here don't give '/' .. which will write in new line ...
itab-f3,
itab-f4,
itab-f5,
itab-f6.
at end of f1.
write :/ ''.
endat.
endloop. -
Two rows from a record commig in single row
Dear All,
This is the query
SELECT ROWNUM,TYP,REF_ID , CODE,FRM_DT , FRM_NOTE
from TABLEA
where TYP='IQ'
AND REF_ID ='IQ1107273'
and (FRM_NOTE LIKE '%AP%' OR FRM_NOTE LIKE '%CL%')
ORDER BY FRM_DT
ROWNUM TYP REF_ID CODE FR_DT FR_NOTE
1 IQ IQ01 IR2460 24/07/2011 AP
2 IQ IQ01 IR2460 25/07/2011 CL
3 IQ IQ02 IR2461 23/07/2011 AP
4 IQ IQ02 IR2461 25/07/2011 CL
could i get this one single row
ROWNUM TYP REF_ID CODE FR_DT FR_NOTE ROWNUM TYP REF_ID CODE FR_DT FR_NOTE
1 IQ IQ01 IR2460 24/07/2011 AP 2 IQ IQ01 IR2460 25/07/2011 CL
3 IQ IQ02 IR2461 23/07/2011 AP 4 IQ IQ02 IR2461 25/07/2011 CL
-----------------------------------------------------------------------------------------------------------------------------------------------------------SQL>WITH t1 AS (SELECT 't1c1_' || ROWNUM AS c1, 't1c2_' || ROWNUM AS c2, ROWNUM AS c3
2 FROM DUAL
3 CONNECT BY LEVEL <= 3),
4 t2 AS (SELECT 't2c1_' || ROWNUM AS c1, 't2c2_' || ROWNUM AS c2, ROWNUM AS c3
5 FROM DUAL
6 CONNECT BY LEVEL <= 3),
7 t3 AS (SELECT t1.c1 AS c11, t1.c2 AS c12, t2.c1 AS c21, t2.c2 AS c22, ROWNUM AS r
8 FROM t1, t2
9 WHERE t1.c3 = t2.c3)
10 SELECT a, b
11 FROM (SELECT c11 AS a, c21 AS b, r, 1 AS s
12 FROM t3
13 UNION ALL
14 SELECT c12, c22, r, 2 AS s
15 FROM t3)
16 ORDER BY r, s;
A B
t1c1_1 t2c1_1
t1c2_1 t2c2_1
t1c1_2 t2c1_2
t1c2_2 t2c2_2
t1c1_3 t2c1_3
t1c2_3 t2c2_3Urs -
Hi,
I have three records in table can I put three records in a single row in alv report,
Please suggest,
rewarded highly
thanks in advance
cheersHi Ray
Why don't you create an internal table with fields of the tables (lfa1, lfb1 and lfm1) you need to read and display?
A vendor has to have the company data if he used by accounting, if he has only org data, It should mean that vendor is used only as partner.
Anyway every org can belong to only one company code and every vendor can belong to several companies (I don't know your organization) so the output table should be:
DATA: BEGIN OF T_OUTPUT OCCURS 0,
<LFA1 FIELDS> LIKE LFA1-.....
<LFB1 FIELDS> LIKE LFB1-.....
<LFM1 FIELDS> LIKE LFM1-.....
END OF T_OUTPUT.
LOOP AT T_LFA1.
MOVE-CORRESPONDING T_LFA1 TO T_OUTPUT.
You should append one record for every org
LOOP AT T_LFM1 WHERE LIFNR = T_LFB1-LIFNR.
Check if this org. belong to company vendor
READ TABLE T_T024E WITH KEY EKORG = T_LFM1-EKORG.
IF NOT T_T024E-BUKRS IS INITIAL.
LOOP AT T_LFB1 WHERE LIFR = LFA1-LIFNR.
AND BUKRS = T_T024E-BUKRS.
You should append one record for every company
MOVE-CORRESPONDING T_LFB1 TO T_OUTPUT,
T_LFM1 TO T_OUTPUT.
APPEND T_OUTPUT.
DELETE: T_LFB1, T_LFM1.
ENDLOP.
ENDIF.
ENDLOOP.
Now you elaborate the org without company:
LOOP AT T_LFM1 WHERE LIFNR = LFA1-LIFNR.
and here you can elaborate the company with out org:
LOOP AT T_LFB1 WHERE LIFNR = LFA1-LIFNR.
MOVE-CORRESPONDING T_LFB1 TO T_OUTPUT,
T_LFM1 TO T_OUTPUT.
APPEND T_OUTPUT.
DELETE: T_LFB1, T_LFM1.
ENDLOOP.
and at the end you can elaborate the last vendor
companies:
LOOP AT T_LFB1 WHERE LIFNR.
MOVE-CORRESPONDING T_LFB1 TO T_OUTPUT.
ENDLOOP.
ENDLOOP.
Max
Check if org. belong to company
IF SY-SUBRC = 0.
MOVE-CORRESPONDING T_LFM1 TO T_OUTPUT.
APPEND T_LFM1.
DELETE T_LFM1
ENDIF.
If vendor haven't company data
ENDLOOP.
ENDLOOP.
Max -
Please help with an sql to show more than one records into single row for each student
From the following data I would like to create an sql to get the information as the following layout
studentid, firstTerm, EnglishMark1,ScienceMark1,MathsMark1, Secondterm,EnglishMark2,ScienceMark2,MathsMark2,
ThirdTerm,EnglishMark3,ScienceMark3,MathsMark3 // As single rows for each student
Example
1 First, 30,40,20,Sec,30,40,20, simillarly next row for next row for another sudent. Please help to generate the sql for the same.
Please help it would be very appreciate.
With Thanks
Pol
polachancreate table yourdata (studentid int, term varchar(10), section varchar(50), Mark int)
insert into yourdata values
(1,'First','Math',20),(1,'First','English',30),(1,'First','Science',40),
(2,'First','Math',20),(2,'First','English',30),(2,'First','Science',40),
(3,'First','Math',20),(3,'First','English',30),(3,'First','Science',40),
(1,'Sec','Math',20),(1,'Sec','English',30),(1,'Sec','Science',40),
(2,'Sec','Math',20),(2,'Sec','English',30),(2,'Sec','Science',40),
(3,'Sec','Math',20),(3,'Sec','English',30),(3,'Sec','Science',40)
Select studentid
,max(case when term='First' and section='English' Then Mark End) as EnglishMark1
,max(case when term='First' and section='Science' Then Mark End) as ScienceMark1
,max(case when term='First' and section='Math' Then Mark End) as MathMark1
,max(case when term='Sec' and section='English' Then Mark End) as EnglishMark2
,max(case when term='Sec' and section='Science' Then Mark End) as ScienceMark2
,max(case when term='Sec' and section='Math' Then Mark End) as MathMark2
,max(case when term='Third' and section='English' Then Mark End) as EnglishMark3
,max(case when term='Third' and section='Science' Then Mark End) as ScienceMark3
,max(case when term='Third' and section='Math' Then Mark End) as MathMark3
From yourdata
Group by studentid
drop table yourdata -
How to Disassemble Varying Multiple Repeating Records from Single Row
I have a flat file that has hundreds of thousands of rows. Each row is a new record.
On each row there are about 23 elements that occur once per row and then there are two groups of 4-6 fields each group that repeat a certain number of times. There is an integer field before each group that indicates how many times the group repeats
0 or greater. An few examples rows are the following.
a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|0|0
a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|1|b|b|b|b|0
a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|2|b|b|b|b|c|c|c|c|0
a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|2|b|b|b|b|c|c|c|c|1|d|d|d|d|d|d
a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|2|b|b|b|b|c|c|c|c|2|d|d|d|d|d|d|e|e|e|e|e|e
a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|0|1|b|b|b|b|b|b
a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|0|2|b|b|b|b|b|b|c|c|c|c|c|c
I'd rather not do a custom pipeline if possible unless there is something already written.
thanks in advance.Thank you for the quick response. Would rather stick in biztalk if possible.
I was able to get something like this to process through no problem.
a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|1|b|b|b|b
a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|0
Just using and unbounded record with the group order type set to sequence. each row could have 0 to hundreds
of groups. And I've been able to process files with millions of rows.
I'm wondering if there is a way to check the integer number in order to tell the group how many records
there will be?
Sucks that it is all the same delimiter. -
Merging Multiple Rows into a single Row
I've read a number of posts with no real good answers or answers that might be good for tables with 3 columns of data. I have a table with 33 columns that will all need to be combined. A little history. Apparently in production the Primary Key Constraint
was dropped which allowed some duplicate data into the table. Now they want me to squish the records together to fix it.
Sorry I couldn't include the screen shot of the data, MSDN says my account isn't verified...
My requirements when I'm putting them together, CERElibilityID is a unique column. This is a sticky problem because in the related tables it is only one of the parent records gets child records related to it.
I just want to keep the one that has the child records in CERPrepActivity table. If there are no child records then the rule will be like all the other records with data.
If a field is null and another record has data we take the record that has data.
If multiple records have data we take the record that has the highest "ModifiedOn" timestamp column value.
I feel like I'm asking a lot, but I'm in a bit of a bind and I've spent the morning Googling and have come up with nothing
Thank you for any help the community can provide and the more specific you can be the better. I'm not a DBA or SQL guru by any stretch so I'm way out of my element.
ThanksUsing the systables, you can get information about your table. I put these together:
SELECT '
LEFT OUTER JOIN #CEREligibility ['+c.name+']
ON s.caseID = ['+c.name+'].caseID
AND s.modifiedOn = ['+c.name+'].modifiedOn
AND ['+c.name+'].['+c.name+'] = (SELECT TOP 1 ['+c.name+'] FROM #CEREligibility WHERE caseID = s.caseID AND ['+c.name+'] IS NOT NULL ORDER BY ModifiedOn)
AND ['+c.name+'].['+c.name+'] IS NOT NULL'
FROM tempdb.sys.objects o
INNER JOIN tempdb.sys.columns c
ON o.object_id = c.object_id
AND o.name LIKE '#CEREligibility%'
SELECT '['+c.name+'].['+c.name+'] AS ['+c.name+'], '
FROM tempdb.sys.objects o
INNER JOIN tempdb.sys.columns c
ON o.object_id = c.object_id
AND o.name LIKE '#CEREligibility%'
On my test system I created your table as a temp table named #CEREligibility.
The first of these two queries generates LEFT OUT JOIN SQL for a self join. Because we're using the columns systable, a LOJ for each column is generated.
The second, produces a select list.
Putting the two together like so, and adding a FROM and GROUP BY gives us:
SELECT
MAX([CEREligibilityId].[CEREligibilityId]) AS [CEREligibilityId], s.[CaseId], MAX([M2Eligibility].[M2Eligibility]) AS [M2Eligibility], MAX([CDREligibility].[CDREligibility]) AS [CDREligibility], MAX([M2Comments].[M2Comments]) AS [M2Comments], MAX([M2CommentsRtf].[M2CommentsRtf]) AS [M2CommentsRtf], MAX([CDRComments].[CDRComments]) AS [CDRComments], MAX([CDRCommentsRtf].[CDRCommentsRtf]) AS [CDRCommentsRtf], MAX([RIAWA].[RIAWA]) AS [RIAWA], MAX([RIAWADate].[RIAWADate]) AS [RIAWADate], MAX([EducationAndTraining].[EducationAndTraining]) AS [EducationAndTraining], MAX([EducationAndTrainingDate].[EducationAndTrainingDate]) AS [EducationAndTrainingDate], MAX([Internship].[Internship]) AS [Internship], MAX([InternshipDate].[InternshipDate]) AS [InternshipDate], MAX([Apprenticeship].[Apprenticeship]) AS [Apprenticeship], MAX([ApprenticeshipDate].[ApprenticeshipDate]) AS [ApprenticeshipDate], MAX([Entrepreneurship].[Entrepreneurship]) AS [Entrepreneurship], MAX([EntrepreneurshipDate].[EntrepreneurshipDate]) AS [EntrepreneurshipDate], MAX([EmploymentPrep].[EmploymentPrep]) AS [EmploymentPrep], MAX([EmploymentPrepDate].[EmploymentPrepDate]) AS [EmploymentPrepDate], MAX([OTPrep].[OTPrep]) AS [OTPrep], MAX([OTPrepDate].[OTPrepDate]) AS [OTPrepDate], MAX([ExitInterview].[ExitInterview]) AS [ExitInterview], MAX([ExitInterviewDate].[ExitInterviewDate]) AS [ExitInterviewDate], MAX([CreatedOn].[CreatedOn]) AS [CreatedOn], MAX([CreatedBy].[CreatedBy]) AS [CreatedBy], MAX([ModifiedOn].[ModifiedOn]) AS [ModifiedOn], MAX([ModifiedBy].[ModifiedBy]) AS [ModifiedBy], MAX([BCPermInEligibility].[BCPermInEligibility]) AS [BCPermInEligibility], MAX([CCPermInEligibility].[CCPermInEligibility]) AS [CCPermInEligibility], MAX([M2EligibilityDate].[M2EligibilityDate]) AS [M2EligibilityDate], MAX([CDREligibilityDate].[CDREligibilityDate]) AS [CDREligibilityDate], MAX([ExitSeparationCode].[ExitSeparationCode]) AS [ExitSeparationCode], MAX([ExitSeparationSubCode].[ExitSeparationSubCode]) AS [ExitSeparationSubCode]
FROM #CEREligibility s
LEFT OUTER JOIN #CEREligibility [CEREligibilityId]
ON s.caseID = [CEREligibilityId].caseID
AND s.modifiedOn = [CEREligibilityId].modifiedOn
AND [CEREligibilityId].[CEREligibilityId] = (SELECT TOP 1 [CEREligibilityId] FROM #CEREligibility WHERE caseID = s.caseID AND [CEREligibilityId] IS NOT NULL ORDER BY ModifiedOn)
AND [CEREligibilityId].[CEREligibilityId] IS NOT NULL
LEFT OUTER JOIN #CEREligibility [CaseId]
ON s.caseID = [CaseId].caseID
AND s.modifiedOn = [CaseId].modifiedOn
AND [CaseId].[CaseId] = (SELECT TOP 1 [CaseId] FROM #CEREligibility WHERE caseID = s.caseID AND [CaseId] IS NOT NULL ORDER BY ModifiedOn)
AND [CaseId].[CaseId] IS NOT NULL
LEFT OUTER JOIN #CEREligibility [M2Eligibility]
ON s.caseID = [M2Eligibility].caseID
AND s.modifiedOn = [M2Eligibility].modifiedOn
AND [M2Eligibility].[M2Eligibility] = (SELECT TOP 1 [M2Eligibility] FROM #CEREligibility WHERE caseID = s.caseID AND [M2Eligibility] IS NOT NULL ORDER BY ModifiedOn)
AND [M2Eligibility].[M2Eligibility] IS NOT NULL
LEFT OUTER JOIN #CEREligibility [CDREligibility]
ON s.caseID = [CDREligibility].caseID
AND s.modifiedOn = [CDREligibility].modifiedOn
AND [CDREligibility].[CDREligibility] = (SELECT TOP 1 [CDREligibility] FROM #CEREligibility WHERE caseID = s.caseID AND [CDREligibility] IS NOT NULL ORDER BY ModifiedOn)
AND [CDREligibility].[CDREligibility] IS NOT NULL
LEFT OUTER JOIN #CEREligibility [M2Comments]
ON s.caseID = [M2Comments].caseID
AND s.modifiedOn = [M2Comments].modifiedOn
AND [M2Comments].[M2Comments] = (SELECT TOP 1 [M2Comments] FROM #CEREligibility WHERE caseID = s.caseID AND [M2Comments] IS NOT NULL ORDER BY ModifiedOn)
AND [M2Comments].[M2Comments] IS NOT NULL
LEFT OUTER JOIN #CEREligibility [M2CommentsRtf]
ON s.caseID = [M2CommentsRtf].caseID
AND s.modifiedOn = [M2CommentsRtf].modifiedOn
AND [M2CommentsRtf].[M2CommentsRtf] = (SELECT TOP 1 [M2CommentsRtf] FROM #CEREligibility WHERE caseID = s.caseID AND [M2CommentsRtf] IS NOT NULL ORDER BY ModifiedOn)
AND [M2CommentsRtf].[M2CommentsRtf] IS NOT NULL
LEFT OUTER JOIN #CEREligibility [CDRComments]
ON s.caseID = [CDRComments].caseID
AND s.modifiedOn = [CDRComments].modifiedOn
AND [CDRComments].[CDRComments] = (SELECT TOP 1 [CDRComments] FROM #CEREligibility WHERE caseID = s.caseID AND [CDRComments] IS NOT NULL ORDER BY ModifiedOn)
AND [CDRComments].[CDRComments] IS NOT NULL
LEFT OUTER JOIN #CEREligibility [CDRCommentsRtf]
ON s.caseID = [CDRCommentsRtf].caseID
AND s.modifiedOn = [CDRCommentsRtf].modifiedOn
AND [CDRCommentsRtf].[CDRCommentsRtf] = (SELECT TOP 1 [CDRCommentsRtf] FROM #CEREligibility WHERE caseID = s.caseID AND [CDRCommentsRtf] IS NOT NULL ORDER BY ModifiedOn)
AND [CDRCommentsRtf].[CDRCommentsRtf] IS NOT NULL
LEFT OUTER JOIN #CEREligibility [RIAWA]
ON s.caseID = [RIAWA].caseID
AND s.modifiedOn = [RIAWA].modifiedOn
AND [RIAWA].[RIAWA] = (SELECT TOP 1 [RIAWA] FROM #CEREligibility WHERE caseID = s.caseID AND [RIAWA] IS NOT NULL ORDER BY ModifiedOn)
AND [RIAWA].[RIAWA] IS NOT NULL
LEFT OUTER JOIN #CEREligibility [RIAWADate]
ON s.caseID = [RIAWADate].caseID
AND s.modifiedOn = [RIAWADate].modifiedOn
AND [RIAWADate].[RIAWADate] = (SELECT TOP 1 [RIAWADate] FROM #CEREligibility WHERE caseID = s.caseID AND [RIAWADate] IS NOT NULL ORDER BY ModifiedOn)
AND [RIAWADate].[RIAWADate] IS NOT NULL
LEFT OUTER JOIN #CEREligibility [EducationAndTraining]
ON s.caseID = [EducationAndTraining].caseID
AND s.modifiedOn = [EducationAndTraining].modifiedOn
AND [EducationAndTraining].[EducationAndTraining] = (SELECT TOP 1 [EducationAndTraining] FROM #CEREligibility WHERE caseID = s.caseID AND [EducationAndTraining] IS NOT NULL ORDER BY ModifiedOn)
AND [EducationAndTraining].[EducationAndTraining] IS NOT NULL
LEFT OUTER JOIN #CEREligibility [EducationAndTrainingDate]
ON s.caseID = [EducationAndTrainingDate].caseID
AND s.modifiedOn = [EducationAndTrainingDate].modifiedOn
AND [EducationAndTrainingDate].[EducationAndTrainingDate] = (SELECT TOP 1 [EducationAndTrainingDate] FROM #CEREligibility WHERE caseID = s.caseID AND [EducationAndTrainingDate] IS NOT NULL ORDER BY ModifiedOn)
AND [EducationAndTrainingDate].[EducationAndTrainingDate] IS NOT NULL
LEFT OUTER JOIN #CEREligibility [Internship]
ON s.caseID = [Internship].caseID
AND s.modifiedOn = [Internship].modifiedOn
AND [Internship].[Internship] = (SELECT TOP 1 [Internship] FROM #CEREligibility WHERE caseID = s.caseID AND [Internship] IS NOT NULL ORDER BY ModifiedOn)
AND [Internship].[Internship] IS NOT NULL
LEFT OUTER JOIN #CEREligibility [InternshipDate]
ON s.caseID = [InternshipDate].caseID
AND s.modifiedOn = [InternshipDate].modifiedOn
AND [InternshipDate].[InternshipDate] = (SELECT TOP 1 [InternshipDate] FROM #CEREligibility WHERE caseID = s.caseID AND [InternshipDate] IS NOT NULL ORDER BY ModifiedOn)
AND [InternshipDate].[InternshipDate] IS NOT NULL
LEFT OUTER JOIN #CEREligibility [Apprenticeship]
ON s.caseID = [Apprenticeship].caseID
AND s.modifiedOn = [Apprenticeship].modifiedOn
AND [Apprenticeship].[Apprenticeship] = (SELECT TOP 1 [Apprenticeship] FROM #CEREligibility WHERE caseID = s.caseID AND [Apprenticeship] IS NOT NULL ORDER BY ModifiedOn)
AND [Apprenticeship].[Apprenticeship] IS NOT NULL
LEFT OUTER JOIN #CEREligibility [ApprenticeshipDate]
ON s.caseID = [ApprenticeshipDate].caseID
AND s.modifiedOn = [ApprenticeshipDate].modifiedOn
AND [ApprenticeshipDate].[ApprenticeshipDate] = (SELECT TOP 1 [ApprenticeshipDate] FROM #CEREligibility WHERE caseID = s.caseID AND [ApprenticeshipDate] IS NOT NULL ORDER BY ModifiedOn)
AND [ApprenticeshipDate].[ApprenticeshipDate] IS NOT NULL
LEFT OUTER JOIN #CEREligibility [Entrepreneurship]
ON s.caseID = [Entrepreneurship].caseID
AND s.modifiedOn = [Entrepreneurship].modifiedOn
AND [Entrepreneurship].[Entrepreneurship] = (SELECT TOP 1 [Entrepreneurship] FROM #CEREligibility WHERE caseID = s.caseID AND [Entrepreneurship] IS NOT NULL ORDER BY ModifiedOn)
AND [Entrepreneurship].[Entrepreneurship] IS NOT NULL
LEFT OUTER JOIN #CEREligibility [EntrepreneurshipDate]
ON s.caseID = [EntrepreneurshipDate].caseID
AND s.modifiedOn = [EntrepreneurshipDate].modifiedOn
AND [EntrepreneurshipDate].[EntrepreneurshipDate] = (SELECT TOP 1 [EntrepreneurshipDate] FROM #CEREligibility WHERE caseID = s.caseID AND [EntrepreneurshipDate] IS NOT NULL ORDER BY ModifiedOn)
AND [EntrepreneurshipDate].[EntrepreneurshipDate] IS NOT NULL
LEFT OUTER JOIN #CEREligibility [EmploymentPrep]
ON s.caseID = [EmploymentPrep].caseID
AND s.modifiedOn = [EmploymentPrep].modifiedOn
AND [EmploymentPrep].[EmploymentPrep] = (SELECT TOP 1 [EmploymentPrep] FROM #CEREligibility WHERE caseID = s.caseID AND [EmploymentPrep] IS NOT NULL ORDER BY ModifiedOn)
AND [EmploymentPrep].[EmploymentPrep] IS NOT NULL
LEFT OUTER JOIN #CEREligibility [EmploymentPrepDate]
ON s.caseID = [EmploymentPrepDate].caseID
AND s.modifiedOn = [EmploymentPrepDate].modifiedOn
AND [EmploymentPrepDate].[EmploymentPrepDate] = (SELECT TOP 1 [EmploymentPrepDate] FROM #CEREligibility WHERE caseID = s.caseID AND [EmploymentPrepDate] IS NOT NULL ORDER BY ModifiedOn)
AND [EmploymentPrepDate].[EmploymentPrepDate] IS NOT NULL
LEFT OUTER JOIN #CEREligibility [OTPrep]
ON s.caseID = [OTPrep].caseID
AND s.modifiedOn = [OTPrep].modifiedOn
AND [OTPrep].[OTPrep] = (SELECT TOP 1 [OTPrep] FROM #CEREligibility WHERE caseID = s.caseID AND [OTPrep] IS NOT NULL ORDER BY ModifiedOn)
AND [OTPrep].[OTPrep] IS NOT NULL
LEFT OUTER JOIN #CEREligibility [OTPrepDate]
ON s.caseID = [OTPrepDate].caseID
AND s.modifiedOn = [OTPrepDate].modifiedOn
AND [OTPrepDate].[OTPrepDate] = (SELECT TOP 1 [OTPrepDate] FROM #CEREligibility WHERE caseID = s.caseID AND [OTPrepDate] IS NOT NULL ORDER BY ModifiedOn)
AND [OTPrepDate].[OTPrepDate] IS NOT NULL
LEFT OUTER JOIN #CEREligibility [ExitInterview]
ON s.caseID = [ExitInterview].caseID
AND s.modifiedOn = [ExitInterview].modifiedOn
AND [ExitInterview].[ExitInterview] = (SELECT TOP 1 [ExitInterview] FROM #CEREligibility WHERE caseID = s.caseID AND [ExitInterview] IS NOT NULL ORDER BY ModifiedOn)
AND [ExitInterview].[ExitInterview] IS NOT NULL
LEFT OUTER JOIN #CEREligibility [ExitInterviewDate]
ON s.caseID = [ExitInterviewDate].caseID
AND s.modifiedOn = [ExitInterviewDate].modifiedOn
AND [ExitInterviewDate].[ExitInterviewDate] = (SELECT TOP 1 [ExitInterviewDate] FROM #CEREligibility WHERE caseID = s.caseID AND [ExitInterviewDate] IS NOT NULL ORDER BY ModifiedOn)
AND [ExitInterviewDate].[ExitInterviewDate] IS NOT NULL
LEFT OUTER JOIN #CEREligibility [CreatedOn]
ON s.caseID = [CreatedOn].caseID
AND s.modifiedOn = [CreatedOn].modifiedOn
AND [CreatedOn].[CreatedOn] = (SELECT TOP 1 [CreatedOn] FROM #CEREligibility WHERE caseID = s.caseID AND [CreatedOn] IS NOT NULL ORDER BY ModifiedOn)
AND [CreatedOn].[CreatedOn] IS NOT NULL
LEFT OUTER JOIN #CEREligibility [CreatedBy]
ON s.caseID = [CreatedBy].caseID
AND s.modifiedOn = [CreatedBy].modifiedOn
AND [CreatedBy].[CreatedBy] = (SELECT TOP 1 [CreatedBy] FROM #CEREligibility WHERE caseID = s.caseID AND [CreatedBy] IS NOT NULL ORDER BY ModifiedOn)
AND [CreatedBy].[CreatedBy] IS NOT NULL
LEFT OUTER JOIN #CEREligibility [ModifiedOn]
ON s.caseID = [ModifiedOn].caseID
AND s.modifiedOn = [ModifiedOn].modifiedOn
AND [ModifiedOn].[ModifiedOn] = (SELECT TOP 1 [ModifiedOn] FROM #CEREligibility WHERE caseID = s.caseID AND [ModifiedOn] IS NOT NULL ORDER BY ModifiedOn)
AND [ModifiedOn].[ModifiedOn] IS NOT NULL
LEFT OUTER JOIN #CEREligibility [ModifiedBy]
ON s.caseID = [ModifiedBy].caseID
AND s.modifiedOn = [ModifiedBy].modifiedOn
AND [ModifiedBy].[ModifiedBy] = (SELECT TOP 1 [ModifiedBy] FROM #CEREligibility WHERE caseID = s.caseID AND [ModifiedBy] IS NOT NULL ORDER BY ModifiedOn)
AND [ModifiedBy].[ModifiedBy] IS NOT NULL
LEFT OUTER JOIN #CEREligibility [BCPermInEligibility]
ON s.caseID = [BCPermInEligibility].caseID
AND s.modifiedOn = [BCPermInEligibility].modifiedOn
AND [BCPermInEligibility].[BCPermInEligibility] = (SELECT TOP 1 [BCPermInEligibility] FROM #CEREligibility WHERE caseID = s.caseID AND [BCPermInEligibility] IS NOT NULL ORDER BY ModifiedOn)
AND [BCPermInEligibility].[BCPermInEligibility] IS NOT NULL
LEFT OUTER JOIN #CEREligibility [CCPermInEligibility]
ON s.caseID = [CCPermInEligibility].caseID
AND s.modifiedOn = [CCPermInEligibility].modifiedOn
AND [CCPermInEligibility].[CCPermInEligibility] = (SELECT TOP 1 [CCPermInEligibility] FROM #CEREligibility WHERE caseID = s.caseID AND [CCPermInEligibility] IS NOT NULL ORDER BY ModifiedOn)
AND [CCPermInEligibility].[CCPermInEligibility] IS NOT NULL
LEFT OUTER JOIN #CEREligibility [M2EligibilityDate]
ON s.caseID = [M2EligibilityDate].caseID
AND s.modifiedOn = [M2EligibilityDate].modifiedOn
AND [M2EligibilityDate].[M2EligibilityDate] = (SELECT TOP 1 [M2EligibilityDate] FROM #CEREligibility WHERE caseID = s.caseID AND [M2EligibilityDate] IS NOT NULL ORDER BY ModifiedOn)
AND [M2EligibilityDate].[M2EligibilityDate] IS NOT NULL
LEFT OUTER JOIN #CEREligibility [CDREligibilityDate]
ON s.caseID = [CDREligibilityDate].caseID
AND s.modifiedOn = [CDREligibilityDate].modifiedOn
AND [CDREligibilityDate].[CDREligibilityDate] = (SELECT TOP 1 [CDREligibilityDate] FROM #CEREligibility WHERE caseID = s.caseID AND [CDREligibilityDate] IS NOT NULL ORDER BY ModifiedOn)
AND [CDREligibilityDate].[CDREligibilityDate] IS NOT NULL
LEFT OUTER JOIN #CEREligibility [ExitSeparationCode]
ON s.caseID = [ExitSeparationCode].caseID
AND s.modifiedOn = [ExitSeparationCode].modifiedOn
AND [ExitSeparationCode].[ExitSeparationCode] = (SELECT TOP 1 [ExitSeparationCode] FROM #CEREligibility WHERE caseID = s.caseID AND [ExitSeparationCode] IS NOT NULL ORDER BY ModifiedOn)
AND [ExitSeparationCode].[ExitSeparationCode] IS NOT NULL
LEFT OUTER JOIN #CEREligibility [ExitSeparationSubCode]
ON s.caseID = [ExitSeparationSubCode].caseID
AND s.modifiedOn = [ExitSeparationSubCode].modifiedOn
AND [ExitSeparationSubCode].[ExitSeparationSubCode] = (SELECT TOP 1 [ExitSeparationSubCode] FROM #CEREligibility WHERE caseID = s.caseID AND [ExitSeparationSubCode] IS NOT NULL ORDER BY ModifiedOn)
AND [ExitSeparationSubCode].[ExitSeparationSubCode] IS NOT NULL
GROUP BY s.caseID
When I ran this against your test data, It produced a single row for each of the two case ID's.
To keep performance in line, I also created a covering index on the temp table:
CREATE INDEX idx_caseID_ModifiedOn ON #CEREligibility (caseID, modifiedOn) INCLUDE ([CEREligibilityId], [M2Eligibility], [CDREligibility], [M2Comments], [M2CommentsRtf], [CDRComments], [CDRCommentsRtf], [RIAWA], [RIAWADate], [EducationAndTraining], [EducationAndTrainingDate], [Internship], [InternshipDate], [Apprenticeship], [ApprenticeshipDate], [Entrepreneurship], [EntrepreneurshipDate], [EmploymentPrep], [EmploymentPrepDate], [OTPrep], [OTPrepDate], [ExitInterview], [ExitInterviewDate], [CreatedOn], [CreatedBy], [ModifiedBy], [BCPermInEligibility], [CCPermInEligibility], [M2EligibilityDate], [CDREligibilityDate], [ExitSeparationCode], [ExitSeparationSubCode])
Don't forget to mark helpful posts, and answers. It helps others to find relevant posts to the same question. -
Single-row subquery returns more than one row - help with update
Hello,
I know this a probably a well documented question but when I checked the search I couldn't find anything relevant to my needs.
I am getting the single-row error when I run this query, i have tried a where exists clause and where column_name in to no avail. Can anyone put me right with this?
My code is:
UPDATE test_sales
SET total =
(SELECT
p.list_price * t.quantity
FROM
test_sales t,
price p
WHERE
t.product_code IN p.product_id
AND
TO_DATE(TO_CHAR(t.order_date,'DD-MON-RR')) >= TO_DATE(TO_CHAR(p.start_date,'DD-MON-RR'))
AND
TO_DATE(TO_CHAR(t.order_date,'DD-MON-RR')) <= TO_DATE(TO_CHAR(p.end_date,'DD-MON-RR'))
AND
t.ship_date IS NOT NULL)the query runs fine on its own and returne 4638 rows which is the number I need to update but it wont work as part of and update. I have also tried this:
UPDATE test_sales
SET total =
(SELECT
p.list_price * t.quantity
FROM
test_sales t,
price p
WHERE
t.product_code IN p.product_id
AND
TO_DATE(TO_CHAR(t.order_date,'DD-MON-RR')) >= TO_DATE(TO_CHAR(p.start_date,'DD-MON-RR'))
AND
TO_DATE(TO_CHAR(t.order_date,'DD-MON-RR')) <= TO_DATE(TO_CHAR(p.end_date,'DD-MON-RR'))
AND
t.ship_date IS NOT NULL)
WHERE product_code IN
(SELECT
product_code
FROM
test_sales t,
price p
WHERE
t.product_code = p.product_id
AND
TO_DATE(TO_CHAR(t.order_date,'DD-MON-RR')) >= TO_DATE(TO_CHAR(p.start_date,'DD-MON-RR'))
AND
TO_DATE(TO_CHAR(t.order_date,'DD-MON-RR')) <= TO_DATE(TO_CHAR(p.end_date,'DD-MON-RR'))
AND
t.ship_date IS NOT NULL)but that wont work either. by uising WHERE and AND clauses that select a match first on product code and then place the order_date in between the start and finish times of a distinct pricing period for each item I figured this would work but it won't. Any ideas what to try?
Mikeor:
SQL> create table test_sales
2 as
3 select 2 quantity, 1 product_code, trunc(sysdate) order_date, trunc(sysdate) ship_date, 0 total from dual
4 /
Tabel is aangemaakt.
SQL> create table price
2 as
3 select 10 list_price, 1 product_id, trunc(sysdate) start_date, trunc(sysdate) end_date from dual
4 /
Tabel is aangemaakt.
SQL> alter table price add constraint price_pk primary key (product_id)
2 /
Tabel is gewijzigd.
SQL> update ( select p.list_price * t.quantity a
2 , t.total
3 from test_sales t
4 , price p
5 where t.product_code = p.product_id
6 and t.order_date between p.start_date and p.end_date
7 and t.ship_date is not null
8 )
9 set total = a
10 /
1 rij is bijgewerkt.Regards,
Rob. -
Hi experts...
I want single row in alv report.
I have use loop for fatch data into internal table using loop when i am passing data in alv report then the data comes according loop. i want onlu one data in alv row.
how can i do such, plz help me.decleare two internal table.
read table itab into wa index 1.
append wa to itab2.
pass itab2 only one record display. -
SQL Update a Single Row Multiple Times Using 2 Data Sets
I'm working in tsql and have an issue where I need to do multiple updates to a single row based on multiple conditions.
By Rank_
If the column is NULL I need it to update no matter what the Rank is.
If the Ranks are the same I need it to update in order of T2_ID.
And I need it to use the last updated output.
I've tried using the update statement below but it only does the first update and the rest are ignored. Here is an example of the data sets i'm working w/ and the Desired results. Thanks in advance!
update a
set Middle = case when a.Rank_> b.Rank_ OR a.Middle IS NULL then ISNULL(b.Middle,a.Middle) end,
LName = case when a.Rank_> b.Rank_ OR a.Lname IS NULL then ISNULL(b.LName,a.LName) end,
Rank_ = case when a.Rank_> b.Rank_ then b.Rank_ end
from #temp1 a
inner join #temp2 b on a.fname = b.fname
where b.T2_ID in (select top 100% T2_ID from #temp2 order by T2_ID asc)The Merge clause actually errors because it attempt to update the same record. I think this CTE statement is the closest I've come but I'm still working through it as I'm not too familiar w/ them. It returns multiple rows which I will have to
insert into a temp table to update since the resulting row I need is the last in the table.
;WITH cteRowNumber
AS(
Select DISTINCT
Row_Number() OVER(PARTITION BY a.LName ORDER BY a.LName ASC, a.Rank_ DESC,b.T2ID ASC) AS RowNumber
,a.FName
,a.LName
,b.LName as xLname
,a.MName
,b.MName AS xMName
,a.Rank_
,b.Rank_ AS xRank
,b.T2ID
FROM #temp1 a
inner join #temp2 b
ON a.fname = b.fname
), cteCursor
AS(
Select a.RowNumber,
a.Fname
,a.LName
,a.xLname
,a.MName
,a.xMName
,a.xRank
,a.T2ID
,CASE WHEN a.Rank_ >= a.xRank THEN ISNULL(a.xRank,a.Rank_) else ISNULL(a.Rank_,a.xRank) end AS Alt_Rank_
,CASE WHEN a.Rank_ >= a.xRank THEN ISNULL(a.xMName,a.MName) else ISNULL(a.MName,a.xMName) end AS Alt_MName
,CASE WHEN a.Rank_ >= a.xRank THEN ISNULL(a.xLName,a.lname) else ISNULL(a.LName,a.xlname) end as Alt_Lname
FROM cteRowNumber a
where a.RowNumber = 1
UNION ALL
Select crt.RowNumber
,crt.FName
,crt.LName
,crt.xLname
,crt.MName
,crt.xMName
,crt.xRank
,crt.T2ID
,CASE WHEN Prev.Alt_Rank_ >= crt.xRank THEN ISNULL(crt.xRank,Prev.Alt_Rank_) else ISNULL(Prev.Alt_Rank_,crt.xRank) end AS Alt_Rank
,CASE WHEN Prev.Alt_Rank_ >= crt.xRank THEN ISNULL(crt.xMName,Prev.Alt_MName) else ISNULL(Prev.Alt_MName,crt.xMName) end AS Alt_MName
,CASE WHEN Prev.Alt_Rank_ >= crt.xRank THEN ISNULL(crt.xLName,Prev.Alt_Lname) else ISNULL(Prev.Alt_Lname,crt.xLName) end as Alt_Lname
FROM cteCursor prev
inner join cteRowNumber crt
on prev.fname = crt.fname and prev.RowNumber + 1 = crt.RowNumber
SELECT cte.*
FROM cteCursor cte -
TWO ERRO ORA-01427: single-row subquery returns more than one row
Hi,
I have a procedure which contains a cursor. If i run the select statement in the cursor separetly, it returns only value and works fine. But the same select statement in the cursor of a procedure throws me the error as below:
TWO ERRO ORA-01427: single-row subquery returns more than one row
Not sure what going on...any help appreciated.
Below is the select statement:
SELECT DISTINCT PSE.PARENT_POSITION_ID,
(SELECT DISTINCT PPD1.SEGMENT2
FROM PER_POSITION_DEFINITIONS PPD1,
HR_ALL_POSITIONS_F HAPF2,
PER_POS_STRUCTURE_ELEMENTS PSE2
WHERE TRUNC(SYSDATE) BETWEEN
HAPF2.EFFECTIVE_START_DATE AND
HAPF2.EFFECTIVE_END_DATE
AND PPD1.POSITION_DEFINITION_ID =
HAPF2.POSITION_DEFINITION_ID
AND
HAPF2.POSITION_ID = PSE2.PARENT_POSITION_ID
AND PSE2.PARENT_POSITION_ID =
PSE.PARENT_POSITION_ID
AND ROWNUM = 1) SEGMENT2,
(SELECT DISTINCT PAPF1.FIRST_NAME || ' ' ||
PAPF1.LAST_NAME CHIEF_NAME
FROM PER_ALL_PEOPLE_F PAPF1,
PER_ALL_ASSIGNMENTS_F PAAF1
WHERE TRUNC(SYSDATE) BETWEEN
PAPF1.EFFECTIVE_START_DATE AND
PAPF1.EFFECTIVE_END_DATE
AND TRUNC(SYSDATE) BETWEEN
PAAF1.EFFECTIVE_START_DATE AND
PAAF1.EFFECTIVE_END_DATE
AND PAAF1.POSITION_ID = PSE.PARENT_POSITION_ID
AND PAPF1.PERSON_ID = PAAF1.PERSON_ID
AND ROWNUM = 1) CHIEF_NAME
FROM PER_POS_STRUCTURE_ELEMENTS PSE,
HR_ALL_POSITIONS_F HAPF,
PER_POSITION_DEFINITIONS PPD
WHERE PSE.SUBORDINATE_POSITION_ID = 52744
AND TRUNC(SYSDATE) BETWEEN HAPF.EFFECTIVE_START_DATE AND
HAPF.EFFECTIVE_END_DATE
AND HAPF.POSITION_ID = PSE.SUBORDINATE_POSITION_ID
AND HAPF.POSITION_DEFINITION_ID = PPD.POSITION_DEFINITION_ID;
Thanks
PK
Edited by: user539616 on Jun 30, 2009 6:30 PMHi,
The cursor has a different parameter? Maybe the query is not exactly the same. Could you check this?
This is your query (formatted):
SELECT DISTINCT PSE.PARENT_POSITION_ID,
(SELECT DISTINCT PPD1.SEGMENT2
FROM PER_POSITION_DEFINITIONS PPD1,
HR_ALL_POSITIONS_F HAPF2,
PER_POS_STRUCTURE_ELEMENTS PSE2
WHERE TRUNC(SYSDATE) BETWEEN HAPF2.EFFECTIVE_START_DATE AND
HAPF2.EFFECTIVE_END_DATE
AND PPD1.POSITION_DEFINITION_ID = HAPF2.POSITION_DEFINITION_ID
AND HAPF2.POSITION_ID = PSE2.PARENT_POSITION_ID
AND PSE2.PARENT_POSITION_ID = PSE.PARENT_POSITION_ID
AND ROWNUM = 1) SEGMENT2,
(SELECT DISTINCT PAPF1.FIRST_NAME || ' ' || PAPF1.LAST_NAME CHIEF_NAME
FROM PER_ALL_PEOPLE_F PAPF1,
PER_ALL_ASSIGNMENTS_F PAAF1
WHERE TRUNC(SYSDATE) BETWEEN PAPF1.EFFECTIVE_START_DATE AND
PAPF1.EFFECTIVE_END_DATE
AND TRUNC(SYSDATE) BETWEEN PAAF1.EFFECTIVE_START_DATE AND
PAAF1.EFFECTIVE_END_DATE
AND PAAF1.POSITION_ID = PSE.PARENT_POSITION_ID
AND PAPF1.PERSON_ID = PAAF1.PERSON_ID
AND ROWNUM = 1) CHIEF_NAME
FROM PER_POS_STRUCTURE_ELEMENTS PSE,
HR_ALL_POSITIONS_F HAPF,
PER_POSITION_DEFINITIONS PPD
WHERE PSE.SUBORDINATE_POSITION_ID = 52744
AND TRUNC(SYSDATE) BETWEEN HAPF.EFFECTIVE_START_DATE AND HAPF.EFFECTIVE_END_DATE
AND HAPF.POSITION_ID = PSE.SUBORDINATE_POSITION_ID
AND HAPF.POSITION_DEFINITION_ID = PPD.POSITION_DEFINITION_ID;Tips: To put formatted code you must use {noformat}{noformat} tags, start tag and end tag are the same,you don't need to put '/' in the close tag.
Regards, -
I need help figuring out how to take data from internet pages and enter it into one single row in an excel, or numbers if that is the easier way to go. I was also told access might be good to use. Basically I am going to chamber of commerce page and wanting to extract the member listing and enter in a database in a single line. The data is in different numbers of lines as you will see below (info edited to take out personal info). So I want to take the name of business, business owner, address, city, state, zip, and phone and put it into one line on a spreadsheet. I want to do this many times over. I think there is a way to do it through apple script and automator, but I have not been successful after 2 weeks of trying and searching. I have over 800 listings and I surely don't want to go through and do them one at a time. Any suggestions?
Data from website:
Westrock Coffee
Mr.
Collins Industrial Place
North Little Rock, AR 72113
Phone:
Send Email
Member Since: 2011
Sweet Creations by DJ
Ms. J
allace Bridge Road
Perryville, AR 72126
Phone:
Fax:
Send Email
Member Since: 2013
See Also Woman Owned and/or CEO
Premium Refreshment Service
Mr. E
est Bethany Road
North , AR 72117
I want it to look like this
Company name, owner name, address, city, state, zip, phone
How can I get the extra data out of the way and remove the format so that it will go into excel? Thanks for any help you can provide. I am not to savvy with code, but I got a friend who is an IT guy that can help. Thanks againSo, basically, create 800 individual entries, each one containing everything from business name through the phone (not fax) number, add some commas and spaces to entries, and then put each entry on a separate line?
1. Go to website page such as this one-- http://www.littlerockchamber.com/CWT/External/WCPages/WCDirectory/Directory.aspx ?ACTION=newmembers --which seems formatwise very close to what you're trying to scrape.
2. Cmd-A to select all. Cmd-C to copy it to clipboard.
3. Open freeware TextWrangler. Cmd-V to paste info from clipboard into a blank TW document.
4. Remove lines from top and bottom so that only membership list remains.
5. Process lines to remove everything from "Fax" line through "See Also" line. Only business name through phone number will remain in the file.
--A. TW > Text > Process Lines containing . . .
-----(check "Delete matched lines"; uncheck all others)
-----Enter "Send Email" in the search box.
-----Click Process.
--B. Repeat 5A for other lines to be removed
------Member Since
------See Also
------Fax
6. Insert markers to separate entries:
TW: Search > Find . . .
------(check "Wrap around" and "Grep")
------in Find box: \r\r\r\r
------in replace box: \r***
------Click Replace All
7. Remove remaining blank lines:
TW: Search > Find . . .
------(check "Wrap around" and "Grep")
------in Find box: \r\r
------in replace box: \r
------Click Replace All
8. Add comma and space at end of each line:
TW: Search > Find . . .
------(check "Wrap around" and "Grep")
------in Find box: $
------in replace box: , (comma space)
------Click Replace All
9. Remove all returns:
TW: Search > Find . . .
------(check "Wrap around" and "Grep")
------in Find box: \r
------in replace box: (leave blank)
------Click Replace All
10. Insert returns in place of markers:
TW: Search > Find . . .
------(check "Wrap around" and "Grep")
------in Find box: \*\*\*, (backslash asterisk backslash asterisk backslash asterisk comma space)
------in replace box: \r
------Click Replace All
11. Remove trailing comma and blank on each line:
TW: Search > Find . . .
------(check "Wrap around" and "Grep")
------in Find box: , $ (comma space dollar sign)
------in replace box: (leave blank)
------Click Replace All
Import this text file into Excel or Numbers. -
Bold a single row in a Report based on SQL Query
Should be easy? So, how do I bold a single row in a report based on SQL query without creating a new template or writing Java for the page? What is the Tabular Form Element "Element Attributes" field for? Or what am I supposed to put in there to make it do anything?
One way to do this is to add a hidden column to your report which contains the formatting value, for example:
select empno
, ename
, sal
, decode(empno,1,'font-weight:bold','font-weight:normal') style
from emp
Hide the STYLE column.
Then you can use this column for each column in Column Formatting > HTML expression in this way:
<span style="#STYLE#">#SAL#</span>
Unfortunately you have to do this for each colum you want to appear bold.
good luck,
Dirk Dral -
Interactive report: Can I exclude a particular column from single row view?
Hi -- I posted on this yesterday (Possible to exclude interactive report column from single row display?
a bit anxious for suggestions, I guess!
I've added a column with edit-link functionality to my interactive report query (that is, the link
is not attached to the database data... it's an additional column and shows an icon). It's also
in addition to the default single row view link. (We need both.)
Unfortunately, the Edit link column shows up in the single row view. I've pared it down as much
as I can: the label is empty, and the null value shows as "-". But an extra row with "-" is pretty
ugly. Is there a way to always, completely exclude this column from the single row view?
I know I could put the edit link on a data column, but:
1) I want the link to always be to the left of the data (and the user can re-order columns)
2) when the user doesn't have edit privileges, the link will need to be disabled or just not
be displayed, and I think that would be a problem if the link were on the data. (true?)
Thanks,
CarolPlease disregard this thread, and the one it refers back to. I see a flaw in the design of what I was attempting to do! Creating the link for Editing as a column means the user could inadvertently not display it, or move it, or... any number of problematic scenarios.
Thanks,
Carol -
Possible to exclude interactive report column from single row display?
hi -- I have an interactive report that I've added a column to (in addition to the table columns that are selected).
The added column is a link to a form for editing a single row. This column/link is in addition to the default link
that goes to a single row view. So, a row of the report has 1) the single row view link, 2) the Edit link,
3) the columns in the table.
The edit link column is named "Edit" (so Edit appears above the "pencil" link icon). Problem is that when the
user goes to the single row view, the Edit column is displayed. (I've set the label in the view to a blank space,
and the value is null (displayed as "-" in the single row view)... but it's generally ugly, and adds that nonsensical
line to the single row view.
Is there any way to never display that column in the single row view, but always display it in the report?
I've considered putting the edit link on the first column of the table... but I don't like that the link will move
if the user changes the column order. It seems it should always be at the left of the row, like the single row view
link.
Thanks,
CarolPlease disregard this thread. I see a flaw in the design of what I was attempting to do! Creating the link for Editing as a column means the user could inadvertently not display it, or move it, or... any number of problematic scenarios.
Thanks,
Carol
Maybe you are looking for
-
MB570Z/A vs MB570Z/B Mini Displayport to DVI adapter
Hi all, Anybody know the difference between the Mini Displayport to DVI adapter MB570Z/A (older and cheaper) and the MB570Z/B Apple currently sells? The "A" version is available elsewhere for about $7 vs $29 for the "B" adapter available from Apple.
-
I don't like anything opening automatically when I start Firefox, so before Firefox 4 I set Firefox to open a blank page when it starts. I still had set a page I visit frequently as my home page, so I could get to that page quickly by pressing the ho
-
MacBook Pro won't boot up. read error 0x7 failes to load a number of drivers?
Dear All, Lately I am having quite a bit of trouble with my Late 2011 MacBook Pro. It seems to be stuck in a vicious circle of boot-ups. Since a couple of days it is taking ages (like 5 min) to boot up, and today it just doesn't get to te "user-scree
-
Hello, My XI 2.0 scenario : Flat file => File adapter => XI => IDoc adapter => SAP 4.7 The File adapter reads the file successfully & passes to the Integration Server. In XI XML message monitor (SXMB_MONI), I'm getting the following error ... =======
-
Hello Friends, Im using alv with checkbox and im getting selected checkbox values in my internal table but now i want to pass this internal table to another transaction and want to display the same in table control in screen painter. also when the us