tsql - Setting specific dates for a variable in SQL -
I will use the lake to specify a specific datetime variable to use. The code will look something like this:
declared @year = declared an integer @JanDate = Datetime set @JanDate = ???
I would like to set month = 1, day = 25, year = = year, @jennet. Not sure that for inserting it for
declared @year integer; SET @ wear = 2013; Announce @JanadetDateTime; Set @JanDate = Cast (NVARCHAR (4) as Cast (+4) + Cast (NVARCHAR (2)) as Cast ('01 ') (NVARCHAR (2) as' 25') DATETIME Please select the result @JanDate: 2013- 01-25 00: 00: 00.000
or just
Declared @year integer; SET @ wear = 2013; Announce @JanadetDateTime; Set @JanDate = Cast (cast (@year as NVARCHAR (4)) + '01' + '25 as DATETIME) Select @JanDate Results: 2013-01-25 00: 00: 00.000
Comments
Post a Comment