I am trying to create some test data where each Employee has a random birthdate. I accomplished the randomizing part but it did not return result in the format that I want.. NOTE: the DateOfBirth column uses the VARCHAR data type.
/****** Generate Random Date For Each Row (Between 1900 - 2015) ******/ UPDATE CCCINC.dbo.Employees SET DateOfBirth = DATEADD(DAY, ABS(CHECKSUM(NEWID()) % 41975), '1900-01-01');
Feb 28 1930 12:00AM
How do I remove the TIME portion from the result? Also, if I wanted to change the DATE format to YYYYMMDD how would I accomplish that?