Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
2
Reply
two select common used in store procedure but result is one
nitish rai
Jan 5 2018 1:50 AM
137
ALTER Proc [dbo].[ProCreateBottleline1POSIMATfinal]
(
@StartDate date,
@EndDate Date
)
As
begin
select * from FloatTable
where cast(DateAndTime as date) between @StartDate and @EndDate
SELECT [0]as [ActivePowerKW],[3]as [PowerFactor],[1]as [CurrentAmp] ,[4] as [VoltageV],[2]as [FrequencyHz],DateAndTime FROM
(
SELECT TagIndex,Val,DateAndTime,Row_Number() Over(partition by TagIndex order by TagIndex,DateAndTime) As ColumnSeries FROM FloatTable
)Temp
Pivot
(
max(Val) For TagIndex in ([0],[3],[1],[4],[2])
)Piv
End
-----------------exec ProCreateBottleline1POSIMATfinal @StartDate='2018-01-04',@EndDate='2018-01-05'
Reply
Upload Source Code
Select only zip and rar file.
Post
Reset
Answers (
2
)
What is the real use of Sql cursor ?
Get the Date time between two dates.