Q&A for students and teachers of all martial arts
declare @Start DATETIME = ##AcceptedAfter:string?2023-01-01## declare @End DATETIME = ##AcceptedBefore:string?2023-03-01## PRINT 'from ' + format(@Start, 'D') + ' to ' + format(@End, 'D') select q.id AS [Post Link], a.id AS [Accepted Answer], a.score AS "Accepted Score" from posts q join posts a on q.acceptedanswerid = a.id --- join q's with a's ---join votes v on a.id = v.postid where q.creationdate between @Start and @End --- asked in RANGE ---and v.votetypeid=1 --- accepted by originator and q.posttypeid=1 --- questions and q.AcceptedAnswerId IS NOT NULL ;