Click here to Skip to main content
15,884,537 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
how to combined one daydate, and one monthname and one yearname in one date just like for example "01/12/2009" in sql server 2005. please send me how to write query.
Posted

What have you tried ? Do you know anything about SQL at all ? Have you considered that asking random strangers to do your work for you is not a great long term business plan ? As I understand this question, it seems trivial to me. Sure, these forums are here to help people, but you know, it would make us feel better if you showed some signs of have a basic understanding of the issue, and of being willing to try to work it out for yourself, too. As it stands, I am not sure you'd understand the answer if we gave it.

I googled and found some SQL code that can take a day, month and year and make a date time using the dateadd function. I wrote an article on how to use google, if you don't know how.

SQL
declare @d datetime;
set @d = dateadd(year,(@Year - 1800),'1/1/1800');
set @d = dateadd(month,@Month - 1,@d);
return dateadd(day,@Day - 1,@d)
 
Share this answer
 
Comments
R. Giskard Reventlov 11-Jun-10 7:37am    
Beat me to it: nice answer.
there are so many functions related to date manipulation in sql 2005
check this for further information

http://msdn.microsoft.com/en-us/library/ms186724.aspx[^]
 
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