Using Dates

0

Please login or register to vote for this query.

(click on this box to dismiss)

Just testing out some dates. MyDate parameter is a string and must in the format of YYYYMMDD

Language Learning

Q&A for students, teachers, polyglots, and anyone interested in the techniques of second-language acquisition

-- Using Dates
-- Just testing out some dates


DECLARE @MyDate DATETIME
Declare @inputDate varchar(8)

Set @InputDate = ##MyDate##
set @MyDate = Convert(datetime, @InputDate)

SELECT *
From posts Where  (SELECT YEAR(CreationDate)) = @inputDate  and CHARINDEX('c++',tags) > 0
order by score;

Enter Parameters

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