Jump to content
Scjordo

Chance StudentID to Birthday format MMDDYY

Recommended Posts

1.       UPDATE Advised_Students (in SchoolScheduling DB) for YOUR StudLastName and change your StudentID to your birthdate in the format of MMDDYY. For example, if you were born Feb 2 1985 the value would be 020285. Since this field is an integer, the leading zero will not be included in the updated value.

Share this post


Link to post
Share on other sites

Use CONVERT function to change the datatype.

SELECT CONVERT(VARCHAR(10), GETDATE(), 101) AS [MM/DD/YYYY]

I hope it'll be helpful.

Thanks!

Share this post


Link to post
Share on other sites

So student id could be 2 lengths for those that do not include a leading zero, and those that do?. what happens if students have same birthdates? For sorting correctly wouldn't be better to have format of yyyymmdd, as mm, and dd will be multiple to month's and years, year will be singular, which then make mm and dd singular to that specific year.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...