Re: I need some help here
- From: "Joseph Byrns" <josephbyrns@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 15 Apr 2005 14:00:37 +0100
You need to pass the date as a date rather than a varchar, so the procedure
would look more like:
create proc test(
@date datetime)
as
begin
select name from table
where
DateEnt = @date
And I would also suggest you change the date to a long date string in the
..NET part, so if you have a date object dt send dt.ToLongDateString (rather
then the ShortDateString you are currently sending).
"Chris" <Chris@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:39925A92-79DB-48D8-BFB0-4DCCB9633E5E@xxxxxxxxxxxxxxxx
> Hi,
> I am storing dates in sql server in this format
>
> 2005-04-13 22:22:16.353
>
> My asp.net app is passing the date as string like this 4/13/2005
>
> to the foll sp
>
>
>
> create proc test(
> @date varchar(11))
>
> as
> begin
>
> select name from table
> where
> LEFT( CONVERT(varchar, DateEnt, 120), 10)= @date
>
> but that doesn't work only if I pass it as 2005-04-13 22:22:16.353. I
> tested
> the proc in sql server
>
> exec test '4/13/2005' but this doesn't work.
>
> exec test '2005-04-14' this works.
>
> Please advice.
>
> Thanks
> Saif
.
- Follow-Ups:
- Re: I need some help here
- From: Chris
- Re: I need some help here
- From: Hans Kesting
- Re: I need some help here
- References:
- I need some help here
- From: Chris
- I need some help here
- Prev by Date: Re: Need help with a regular expression!
- Next by Date: Input type file mysteriously disabled
- Previous by thread: I need some help here
- Next by thread: Re: I need some help here
- Index(es):
Relevant Pages
|