Getting Started with Adobe After Effects - Part 6: Motion Blur


Upload Image Close it
Select File

My Experiments with SQLServer
Browse by Tags · View All
SQLServer 126
SQLServer 2008 R2 91
SQLServer 2008 86
SQLServer 2005 82
SQL 60
Database 59
Sql And Me 57
Tips & Tricks 28
SQL Server 27
SQL FAQ 26

Archive · View All
May 2011 25
June 2011 21
July 2011 21
August 2011 19
April 2011 16
January 2013 4
May 2012 3
April 2012 3
October 2011 3
February 2013 2

Vishal Gajjar's Blog

SQL Server – Denali CTP3 – DATEFROMPARTS() and TIMEFROMPARTS()

Jul 18 2011 8:29AM by Vishal Gajjar   

These are new functions in SQL Server "Denali". DATEFROMPARTS() returns a DATE value with specified day, month and year.

It takes three arguments:

DATEFROMPARTS (@Year, @Month, @Day)

If the arguments are invalid, it raises an error.

– © 2011 – Vishal (http://SqlAndMe.com)
 
SELECT DATEFROMPARTS (2011, 07, 18) AS 'Today'

Result Set:

Today
———-
2011-07-18
 
(1 row(s) affected)

Similarly, we can use DATETIMEFROMPARTS() to generate a DATETIME value.

It takes the form:

DATETIMEFROMPARTS (@Year, @Month, @Day, @Hour, @Minute, @Seconds, @Milliseconds)

If the arguments are invalid, an error is raised.

SELECT DATETIMEFROMPARTS (2011, 07, 18, 21, 01, 20, 700) AS 'Today'

Result Set:

Today
———————–
2011-07-18 21:01:20.700
 
(1 row(s) affected)

There is a function for TIME also, TIMEFROMPARTS(). It takes below arguments:

TIMEFROMPARTS (@Hour, @Minute, @Seconds, @Fractions, @Precision)

SELECT TIMEFROMPARTS ( 21, 01, 20, 070, 3) AS 'Now'

Result Set:

Now
—————-
21:01:20.070
 
(1 row(s) affected)

Also, there are similar functions for DATETIME2, DATETIMEOFFSET and SMALLDATETIME.

Hope This Helps! Cheers!


Republished from Sql&Me [31 clicks].  Read the original version here [32134 clicks].

Vishal Gajjar
46 · 4% · 1276
0
Liked
 
0
Lifesaver
 
0
Refreshed
 
0
Learned
 
0
Incorrect



Submit

Your Comment


Sign Up or Login to post a comment.

    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]