Re: Date Conversion
From: Sarah (skingswell_at_donotreply.com)
Date: 02/27/04
- Next message: Sarah: "Re: Date Conversion"
- Previous message: Hari: "Re: Urgent!! How to recover the deleted table"
- In reply to: Hari: "Re: Date Conversion"
- Next in thread: Al: "RE: Date Conversion"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 27 Feb 2004 11:44:37 -0000
The problem that I am having is the format of the date because if I actually
look at the Date values in the table with the enterprise manager they are in
the same format as the @tempdate variable
25/05/2004
but the select query returns 2004-05-25 00:00:00. This is why I am
converting the select results. I still cannot get this working.
"Hari" <hari_prasad_k@hotmail.com> wrote in message
news:OUg2CeR$DHA.1452@TK2MSFTNGP09.phx.gbl...
> Hi,
>
> Infact you dont require a conversion in that place, because it seems the
> Date field in the table is datetime datatype and @tempdate variable also a
> datetime datype.
> In this case you dont require a convert.
>
> Incase you need to convert please use 101 instead of 103.
>
> Thanks
> Hari
> MCDBA
>
> "Sarah" <skingswell@donotreply.com> wrote in message
> news:u6RnNUR$DHA.220@TK2MSFTNGP09.phx.gbl...
> > I need some help with Date Conversions. I am getting the following
error
> > when I run the query below.
> >
> > The conversion of a char data type to a datetime data type resulted in
an
> > out-of-range datetime value.
> >
> > declare @inputdate char(10)
> > declare @tempdate datetime
> > declare @validdate char(10)
> >
> > SET @inputdate = '15/05/2004'
> >
> > SET @tempdate = (SELECT convert (char(10), Date, 103) FROM [The
> Company -
> > Dev$Base Calendar Change]
> > WHERE Date = @InputDate and Nonworking = '1')
> > if @tempdate is not null
> > SET @validdate = '0' else SET @validdate = '1'
> > select @validdate
> >
> >
>
>
- Next message: Sarah: "Re: Date Conversion"
- Previous message: Hari: "Re: Urgent!! How to recover the deleted table"
- In reply to: Hari: "Re: Date Conversion"
- Next in thread: Al: "RE: Date Conversion"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|