Search SO Answers

0

Please login or register to vote for this query.

(click on this box to dismiss)

Motor Vehicle Maintenance and Repair Meta

Q&A about the site for mechanics and DIY enthusiast owners of cars, trucks, and motorcycles

DECLARE @SearchText VARCHAR(100) = ##SearchText:string##
DECLARE @OnlyBeginning BIT = ##OnlyBeginning:int##
DECLARE @After DATETIME = ##After:string##
DECLARE @Before DATETIME = ##Before:string##

SELECT TOP 100
  Id,
  Id AS [Post Link],
  CreationDate,
  Body
FROM Posts
WHERE PostTypeId = 2
    AND
      (
        (@OnlyBeginning = 1 AND Body LIKE '<p>' + @SearchText + '%') OR
        (@OnlyBeginning = 0 AND Body LIKE '%' + @SearchText + '%')
      )
AND (CreationDate >= @After)
AND (CreationDate <= @Before)
ORDER BY CreationDate DESC

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results