TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
jalil jalal
NA
31
538
src Pivot sql with parametrs
Mar 16 2018 1:09 PM
Hello,
I just did advanced actions in SQL, but I found some difficulty. In short, I want to display some data (name, grade, and premium date) between two dates (Start and End), but by rotating the date to have a display as a result
My request is :
SELECT
*
FROM
(
SELECT
E.LastName +
', '
+ e.FirstName
as
name
,E.grade ,t.
Date
d
FROM
table
e )src pivot(
max
(d)
for
d
IN
([2017-12-18 00:00:00.000] ,[2017-12-19 00:00:00.000] ,[2017-12-20 00:00:00.000] ,[2017-12-21 00:00:00.000] ) )
as
p
All is well, but what I want to do is enter a start and end date as parameters instead of putting the dates in the for d in (...) clause. And the dates that will be rotated must be within this set date range.
I tried to create a parameterized procedure and put it in for IN (MyProc) but it does not work and thank you in advance for your cooperation
Reply
Answers (
1
)
Repalce in Regular expression with item text
reset invNo for the next financial year