Click here to Skip to main content
12,352,739 members (67,498 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: SQL-Server
how to write the query for getting current date in sqlserver.

please send the code
Posted 21-Nov-12 0:09am
Comments
__TR__ 21-Nov-12 6:11am
   
SELECT GETDATE()[^]
CPallini 21-Nov-12 6:19am
   
My (virtual) 5.
sarathviper 21-Nov-12 6:11am
   
Directly put DateTime.Now
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

GETDATE()[^], as __TR__ already suggested.
  Permalink  
v3
Comments
Sunasara Imdadhusen 23-May-13 8:35am
   
This is correct solution, please accept it
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Select GETDATE()
Try this.
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

you want date with time then use
Select GetDate()

for Only date then use
select convert (datetime,convert(varchar(10),getdate(),102))

Happy Coding!
Smile | :)
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 4

Select GETDATE() is use to get current date n time as suggessted
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web01 | 2.8.160621.1 | Last Updated 21 Nov 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100