Viewing 15 posts - 1 through 15 (of 16 total)
we're not able to understand Exact requirement . please give us to sample output. we will try to help you.
select COUNT(Patient), CONVERT(varchar,[DATE OF VISIT],121),PATIENT from #VISITS
group by [DATE...
February 18, 2016 at 11:54 pm
As per your scenarios
For example : you have data for tableA and tableC but you don't have data for TableB . And you don't have direct relationship...
February 5, 2016 at 1:55 am
sample logic but super :). i am trying about to 2hrs but i am not getting good result.thanks ChrisM@Work
February 3, 2016 at 3:10 am
create table UserName (FirstName varchar(50),LastName varchar(50))
insert into Username select 'Abhas' ,'Jadhav'
Union
select 'Ashwin' ,'Jadhav'
UNION
select 'Akash','Jadhav'
UNION
select 'Bbhas' ,'Jadhav'
Union
select 'Bshwin' ,'Jadhav'
UNION
select 'Bkash','Jadhav'
with cte as
(
select newid () sysid ,(SUBSTRING(FirstName,1,1)) firstname ,lastname...
January 29, 2016 at 5:05 am
declare @STR nvarchar(1000), @str1 nvarchar(400), @str2 nvarchar(500), @concat nvarchar(1000), @i int, @j-2 int
set @STR = '$I10~TESTING1$XYZ$I10~TESTING2$ABZ$I10~TESTING4'
select @str1 = SUBSTRING(@str,CHARINDEX('$I10~',@str) +5,7)
select @j-2...
October 26, 2015 at 10:38 pm
please go through this below link it will help much to you
http://stackoverflow.com/questions/56628/how-do-you-clear-the-sql-server-transaction-log
July 20, 2015 at 3:02 am
please follow for below given link then you will be get idea
July 15, 2015 at 5:55 am
I also faced this type of problem from ssis packages.
we have two possibilities do this work
1) schedule the package for there interval timings.
2) what data...
August 12, 2014 at 5:55 am
If u need that result ,u have to change the joins AS I mention in below
SELECT E1.Place, E1.Objective,E1.Year,E1.Month,E1.Exam1, E2.Exam2,E3.Exam3 FROM #tmpExam1 E1
LEFT JOIN #tmpExam2 E2 ON E2.Year = E1.Year...
August 12, 2014 at 4:33 am
If u need that result ,u have to change the joins AS I mention in below
SELECT E1.Place, E1.Objective,E1.Year,E1.Month,E1.Exam1, E2.Exam2,E3.Exam3 FROM #tmpExam1 E1
LEFT JOIN #tmpExam2 E2 ON E2.Year = E1.Year...
August 12, 2014 at 4:32 am
If u need that result ,u have to change the joins AS I mention in below
SELECT E1.Place, E1.Objective,E1.Year,E1.Month,E1.Exam1, E2.Exam2,E3.Exam3 FROM #tmpExam1 E1
LEFT JOIN #tmpExam2 E2 ON E2.Year = E1.Year...
August 12, 2014 at 4:32 am
Are u really need index for all columns?. if u not needed for columns ,remove that columns then get improvement .
if u needed all columns then go for covered...
August 4, 2014 at 3:19 am
SELECT [CampusID],Campus1,Campus2,[TermID],[Term],[StudentID],[Qualification],[Programme],status,
[Value] FROM(
select
[CampusID]
,[Campus]
,[TermID]
,[Term]
,[StudentID]
,[Qualification]
,[Programme]
,[status]
,[value]
from
(
SELECT
[CampusID]
,[Campus]
,[TermID]
,[Term]
,[StudentID]
,[Qualification]
,[Programme]
,[Repeat1stYear]
,[Repeat2ndYear]
,[Repeat3rdYear]
,[ProgTo2ndYear]
,[ProgTo3rdYear]
,[ProgToCompleteQual]
,[NotReturn2ndYr]
,[NotReturn3rdYr]
,[NotReturn4thYr]
FROM [dbo].[MyTable]
)p
unpivot (value for [status]in
(
[Repeat1stYear]
,[Repeat2ndYear]
,[Repeat3rdYear]
,[ProgTo2ndYear]
,[ProgTo3rdYear]
,[ProgToCompleteQual]
,[NotReturn2ndYr]
,[NotReturn3rdYr]
,[NotReturn4thYr]
))as unpvt) p
PIVOT
(
MAX (Campus)
FOR Campus IN
( Campus1,Campus2 )) AS pvt
ORDER BY studentid, termid
April 17, 2014 at 12:46 am
please send me sample result 🙂
April 15, 2014 at 3:37 am
you can try this
SELECT name1, name2, name3,empn
,[Jan-13]=MAX(CASE WHEN month1 = '2013-01-01' THEN emp END)
,[Feb-13]=MAX(CASE WHEN month1 = '2013-01-02' THEN emp...
March 11, 2014 at 5:48 am
Viewing 15 posts - 1 through 15 (of 16 total)