
March 19th, 2005, 09:44 PM
|
|
Registered User
|
|
Join Date: Mar 2005
Posts: 2
Time spent in forums: 46 m 13 sec
Reputation Power: 0
|
|
|
DateTime Conversion and Comparison
Hi All,
New to SQL and I'm having some trouble trying to do something simple. I need to pull data from a table that is corresponding to a month that is determine by the user.
I have created a stored procedure and it looks like this
create procedure uspBkMth @Mth char(10) as
select @Mth = @Mth + '%'
select dte from tblTest where cast(dte as char(10)) like @Mth
Somehow the above procedure returns nothing when I execute as below :
exec uspBkMth 'Dec'
tblTest stored dte in datetime format and I'm using MS SQL. Can someone help me with this?
Thanks in advance
Jon
|