Click here to Skip to main content
15,884,298 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
how to write the query for getting current date in sqlserver.

please send the code
Posted
Comments
__TR__ 21-Nov-12 6:11am    
SELECT GETDATE()[^]
CPallini 21-Nov-12 6:19am    
My (virtual) 5.
sarathtamil 21-Nov-12 6:11am    
Directly put DateTime.Now

Select GETDATE() is use to get current date n time as suggessted
 
Share this answer
 
you want date with time then use
SQL
Select GetDate()


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


Happy Coding!
:)
 
Share this answer
 
GETDATE()[^], as __TR__ already suggested.
 
Share this answer
 
v3
Comments
Sunasara Imdadhusen 23-May-13 8:35am    
This is correct solution, please accept it
SQL
Select GETDATE()

Try this.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900