MVC

  • Home
  • HTML
    • Overview
    • Formatting
  • Java Script
    • Overview
    • Validation
  • CSS
    • Overview
  • Sql
    • Overview
    • SQL Select
    • SQL Command
    • Advance Query
    • SQL Create
    • Function
    • Function vs StoreProcedure
    • Stored Procedures
  • MVC
    • OverView
    • Evolution of MVC
    • Install VisualStudio-2015
    • Create First Application
  • LINQ
    • Introduction
  • Privacy Policy

Wednesday, 15 November 2017

Date Formate in Sql

  Unknown       07:16       Function       No comments    

Show Current Date-

  Show Current Date Then Use-
 
  SELECT GETDATE()  AS CurrentDate
OutPut-
           2016-06-08 12:11:00.083

 More Format In Date Then Use-
 
Ex. 1:
 SELECT CONVERT(varchar(20),GETDATE(),100)  AS CurrentDate
OutPut-
           Jun  8 2016 12:13PM 

 Ex.2:
 SELECT CONVERT(varchar(20),GETDATE(),101)  AS CurrentDate
OutPut
       06/08/2016

Ex.3:
 SELECT CONVERT(varchar(20),GETDATE(),102)  AS CurrentDate
OutPut
      2016.06.08

Ex.4:
 SELECT CONVERT(varchar(20),GETDATE(),103)  AS CurrentDate 
OutPut
     08/06/2016

Ex.5 

  • CONVERT(varchar(20),GETDATE(),104)  =  08.06.2016.
  • CONVERT(varchar(20),GETDATE(),105 )=  08-06-2016
  • CONVERT(varchar(20),GETDATE(),106) =  08 Jun 2016
  • CONVERT(varchar(20),GETDATE(),107) =  Jun 08, 2016
  • CONVERT(varchar(20),GETDATE(),108) =  12:24:08
  • CONVERT(varchar(20),GETDATE(),109) =  Jun 08, 2016
  • CONVERT(varchar(20),GETDATE(),110) =  06-08-2016
  • CONVERT(varchar(20),GETDATE(),111) = 2016/06/08
  • CONVERT(varchar(20),GETDATE(),112) = 20160608
  • CONVERT(varchar(20),GETDATE(),113) = 08 Jun 2016 12:26:08

ONLY FATCH TIME IN DATE THEN USE

EX.1

 SELECT (LTRIM( RIGHT(CONVERT(varchar(20),GETDATE(),100),7))) as  CURRENTTime
 OutPut
     12:28PM
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
Email This BlogThis! Share to X Share to Facebook
Older Post Home

0 comments :

Post a Comment

learningmvctutorial

Popular Posts

  • Overview of HTML
    What is HTML? First developed by Tim Berners-Lee in 1990 . HTML is used to create electronic documents (called pages) that are displ...
  • Overview
      SQL (Structured Query Language)   SQL  is a language that interacts with the database on the server-side. This dynamite duo has changed ...
  • Difference Between function v/s store procedure
    Definition  of Store Procedure In a database management system (DBMS), a  stored procedure  is a set of Structured Query Language (SQL...
  • What is LINQ
    LINQ  (Language Integrated Query) is a Microsoft programming model and methodology that essentially adds formal query capabilities into Mic...
  • What is Function in Sql Server
    A function is a block of code that has a name and it has a property that it is reusable. We use function in store Procedure and queries in...
  • SQL Select
    The SQL SELECT Statement The SELECT statement is used to select data from a database. SQL SELECT Syntax SELECT column_name , column_n...
  • About Javascript
    What is JavaScript? JavaScript was designed to add interactivity to HTML pages JavaScript is a scripting language A scripting langua...
  • Create Duplicate Table of existing table in SQL Server
    In This Tutorial we create table and want to same structure and same data then We create new table with data type after that  insert in ta...
  • Operator in JavaScript
    What is an operator? JavaScript has both binary and unary operators, and one special ternary operator, the conditional operator. A binar...
  • Create First Application in MVC
    We want to create Firstly application in MVC first of how we create first application Show Steps   as below-     STEP 1 .  Start Computer ...

Blog Archive

  • ▼  2017 ( 35 )
    • ▼  November ( 1 )
      • Date Formate in Sql
    • ►  October ( 2 )
    • ►  September ( 4 )
    • ►  August ( 1 )
    • ►  July ( 1 )
    • ►  May ( 3 )
    • ►  April ( 7 )
    • ►  March ( 13 )
    • ►  February ( 3 )
Powered by Blogger.

Categories

  • AdvanceQuery
  • CreateApplication
  • CreateDb
  • CssOverview
  • Evolution
  • Formatting
  • Function
  • FunctionVSSp
  • HtmlOverview
  • InstallVisualStudio
  • Introduction
  • javascriptOverview
  • JsValidation
  • Mvc-vs-Asp.Net
  • OverView
  • Select
  • SqlCommand
  • SQLOverview
  • StoredProcedures

Text Widget

Sample Text

Pages

  • Home

Copyright © MVC | Powered by Blogger
Design by Vibha Acharya