Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date manipulation

Status
Not open for further replies.

edwardturner

Technical User
Jul 13, 2005
25
GB
Hello,

Can anyone help me with this problem.

I have a column that contains values for years and another column containing dates.

What I want to do is update the date column and default the value of day and month to the 1st of Janurary and then change the value for the year to what is in the year column.

I am having trouble pulling all of this together, can anyone help me out?

Cheers.
 
try:
Code:
SET DateCol = cast('1/1/' + cast(YearCol as varchar(4)) as datetime)


Bob Boffin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top