Click here to Skip to main content
Rate this: bad
good
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 1:09am
Comments
__TR__ at 21-Nov-12 6:11am
   
SELECT GETDATE()[^]
CPallini at 21-Nov-12 6:19am
   
My (virtual) 5.
sarathviper at 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 at 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)



Advertise | Privacy | Mobile
Web01 | 2.8.150327.1 | Last Updated 21 Nov 2012
Copyright © CodeProject, 1999-2015
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