• +91 9723535972
  • info@interviewmaterial.com

MS SQL Interview Questions and Answers

Question - How do I retrieve only the date or time portion of the data?

Answer - You can use T-SQL's DATEPART() function to return a subset of the values that SQL Server's datetime columns store. The DATEPART() function uses two arguments. The first argument specifies the portion of the date that you want, and the second value specifies the datetime column: SELECT orderID, DATEPART(MM,OrderDate) AS OrderMonth FROM Orders

Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners