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
Paul Rajs
NA
641
148.4k
How to bind Records by Order using Asp.Net C# or Sql
Oct 3 2018 8:15 AM
Hi Friends ,
I am creating a project for ngo trust.A sponsor have to make birthday wishes for their adopted childs.its one or more than one.
my Requirement is in birthday home page i have 3 children (it can be less or more)
1.if i click 2 nd child the next page should bind 2nd child first then other two childs details . the problem is i am using slider.
2.if i click 3rd child to wish the next page should bind 3 rd child first then bind other two childs details on the slider one by one.
now i have bind 3 childrens order by birthdate . but how can i bind Clicked child firts and others next .
anyone know kindly suggest me to done this task.
thanking you
Paul.S
this is the Sql query which is am using
SELECT
q1.*,
CASE
WHEN
MONTH
(q1.Birthdate)=
MONTH
(GETDATE())
AND
DAY
(q1.Birthdate)>=
DAY
(GETDATE())
THEN
0
WHEN
MONTH
(q1.Birthdate)>
MONTH
(GETDATE())
THEN
1
ELSE
2
END
AS
ChildOrder
FROM
(
SELECT
PD.PledgeId, CD.ChildID, CD.GivenName
as
ChildName, CD.Birthdate, (
CONVERT
(
int
,DATEDIFF(d, CD.Birthdate, GETDATE()) / 365.25)+1)
AS
Age, DATENAME(
MONTH
, CD.Birthdate)
AS
BirthMonth,
CONVERT
(
CHAR
(3), DATENAME(
MONTH
, CD.Birthdate))
AS
BirthMonth2,
DAY
(CD.Birthdate)
as
BirthDay, 2
AS
NoDays, CD.WebPhotoPath
as
WebPhotoPath, PD.PaidThruDate,
CONVERT
(
DATE
,DATEADD(
day
,-45,
REPLACE
(CD.Birthdate,
YEAR
(CD.Birthdate),
YEAR
(GETDATE()))))
as
BtnBDayDate1,
CONVERT
(
DATE
,DATEADD(
day
,+45,
REPLACE
(CD.Birthdate,
YEAR
(CD.Birthdate),
YEAR
(GETDATE()))))
as
BtnBDayDate2
FROM
Pledge_PledgeDetails PD
INNER
JOIN
Child_ChildDetails CD
ON
CD.ChildID=PD.ChildID
WHERE
PD.LeadID=@LeadID
AND
CD.ProjectID
not
in
(167948,197358,178124)
AND
PD.Status
in
(2)
and
(
CONVERT
(
DATE
,GETDATE())
-- Display child's birthday with 45 days interval BETWEEN CONVERT(DATE,DATEADD(day,-45, REPLACE(CD.Birthdate, YEAR(CD.Birthdate), YEAR(GETDATE())))) AND CONVERT(DATE,DATEADD(day,+45, REPLACE(CD.Birthdate, YEAR(CD.Birthdate), YEAR(GETDATE())))) OR CONVERT(DATE,GETDATE()) BETWEEN CONVERT(DATE,DATEADD(day,-45, REPLACE(CD.Birthdate, YEAR(CD.Birthdate), (YEAR(GETDATE())-1)))) AND CONVERT(DATE,DATEADD(day,+45, REPLACE(CD.Birthdate, YEAR(CD.Birthdate), (YEAR(GETDATE())-1)))) ) ) AS q1 WHERE q1.ChildID NOT IN (SELECT ChildID FROM CMS_ChildBirthdayWishes WHERE CreatedDate BETWEEN q1.BtnBDayDate1 AND q1.BtnBDayDate2) ORDER BY ChildID,ChildOrder, MONTH(q1.Birthdate), DAY(q1.Birthdate) ASC
Reply
Answers (
1
)
how to compare schema and data of two different databases
How to live notification on MVC?