Click here to Skip to main content
15,904,934 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i have declared a paramter named date as a varchar in my procedure .
within procedure i want to change it in datetime .
how can i change it .
thanks in advance
Posted

1 solution

As i understand your question try this,
CAST(parameter AS DATETIME)
 
Share this answer
 
Comments
pawanvats 15-Dec-10 5:59am    
no actually i have declare date parameter as varchar in my parameter list of procedure .
now in my procedure i want to use date parameter as datetime.
.
and please tell me where i need to implement your code
and how.
Toniyo Jackson 15-Dec-10 6:06am    
After your parameter declaration,
DECLARE @date datetime= CAST(parameter AS DATETIME);
Then use this @date in remaining code.

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