Created
January 28, 2015 19:24
-
-
Save CodyEngel/89a5267236895fa4b414 to your computer and use it in GitHub Desktop.
Random date time with the year and month hard coded.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT '2015-01-' | |
+ RIGHT('00' + CAST( | |
ROUND(((28 - 1 -1) * RAND() + 1), 0) | |
AS varchar), 2) | |
+ ' ' | |
+ RIGHT('00' + CAST( | |
ROUND(((24 - 0 -0) * RAND() + 0), 0) | |
AS varchar), 2) -- Hour | |
+ ':' | |
+ RIGHT('00' + CAST( | |
ROUND(((59 - 0 -0) * RAND() + 0), 0) | |
AS varchar), 2)-- Minute | |
+ ':' | |
+ RIGHT('00' + CAST( | |
ROUND(((59 - 0 -0) * RAND() + 0), 0) | |
AS varchar), 2)-- Second | |
+ '.' | |
+ RIGHT('000' + CAST( | |
ROUND(((999 - 0 -0) * RAND() + 0), 0) | |
AS varchar), 3)-- Microsecond |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment