Updating DateTime?

Updating DateTime?

am 25.10.2004 15:35:09 von jason

Help! How does one UPDATE date and time field in Sql server:

Eg: u_ExpiryDate = 8/25/2004 3:40:48


If I try this:

UPDATE t_user
SET u_ExpiryDate = 8/25/2004 3:40:48
WHERE u_ID > 1

I pick up an error.

Appreciate replies

Thanks
Jason

Re: Updating DateTime?

am 25.10.2004 15:58:33 von ten.xoc

http://www.aspfaq.com/2023

--
http://www.aspfaq.com/
(Reverse address to reply.)




wrote in message
news:uJelzdpuEHA.2144@tk2msftngp13.phx.gbl...
> Help! How does one UPDATE date and time field in Sql server:
>
> Eg: u_ExpiryDate = 8/25/2004 3:40:48
>
>
> If I try this:
>
> UPDATE t_user
> SET u_ExpiryDate = 8/25/2004 3:40:48
> WHERE u_ID > 1
>
> I pick up an error.
>
> Appreciate replies
>
> Thanks
> Jason
>
>

Re: Updating DateTime?

am 25.10.2004 16:04:16 von reb01501

jason@catamaranco.com wrote:
> Help! How does one UPDATE date and time field in Sql server:
>
> Eg: u_ExpiryDate = 8/25/2004 3:40:48
>
>
> If I try this:
>
> UPDATE t_user
> SET u_ExpiryDate = 8/25/2004 3:40:48
> WHERE u_ID > 1
>
> I pick up an error.
>
> Appreciate replies
>
> Thanks
> Jason

http://www.aspfaq.com/show.asp?id=2313 vbscript
http://www.aspfaq.com/show.asp?id=2040 help with dates
http://www.aspfaq.com/show.asp?id=2260 dd/mm/yyy confusion

Basically, dates should be supplied to sql in unambiguous format (yyyymmdd
hh:mm:ss), and they should be quote-delimited. Of course, using parameters
relieves you of the necessity to worry about delimiters.

Bob Barrows

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Re: Updating DateTime?

am 25.10.2004 16:13:40 von reb01501

Aaron [SQL Server MVP] wrote:
> http://www.aspfaq.com/2023
>
Damn! How did I miss that one?
Bob
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Re: Updating DateTime?

am 25.10.2004 21:12:58 von jason

Thanks
"Aaron [SQL Server MVP]" wrote in message
news:eJ%23H7rpuEHA.1404@TK2MSFTNGP11.phx.gbl...
> http://www.aspfaq.com/2023
>
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
>
>
> wrote in message
> news:uJelzdpuEHA.2144@tk2msftngp13.phx.gbl...
> > Help! How does one UPDATE date and time field in Sql server:
> >
> > Eg: u_ExpiryDate = 8/25/2004 3:40:48
> >
> >
> > If I try this:
> >
> > UPDATE t_user
> > SET u_ExpiryDate = 8/25/2004 3:40:48
> > WHERE u_ID > 1
> >
> > I pick up an error.
> >
> > Appreciate replies
> >
> > Thanks
> > Jason
> >
> >
>
>

Re: Updating DateTime?

am 25.10.2004 21:14:03 von jason

Thanks got it.

"Bob Barrows [MVP]" wrote in message
news:OpAyAupuEHA.272@TK2MSFTNGP15.phx.gbl...
> jason@catamaranco.com wrote:
> > Help! How does one UPDATE date and time field in Sql server:
> >
> > Eg: u_ExpiryDate = 8/25/2004 3:40:48
> >
> >
> > If I try this:
> >
> > UPDATE t_user
> > SET u_ExpiryDate = 8/25/2004 3:40:48
> > WHERE u_ID > 1
> >
> > I pick up an error.
> >
> > Appreciate replies
> >
> > Thanks
> > Jason
>
> http://www.aspfaq.com/show.asp?id=2313 vbscript
> http://www.aspfaq.com/show.asp?id=2040 help with dates
> http://www.aspfaq.com/show.asp?id=2260 dd/mm/yyy confusion
>
> Basically, dates should be supplied to sql in unambiguous format (yyyymmdd
> hh:mm:ss), and they should be quote-delimited. Of course, using parameters
> relieves you of the necessity to worry about delimiters.
>
> Bob Barrows
>
> --
> Microsoft MVP -- ASP/ASP.NET
> Please reply to the newsgroup. The email account listed in my From
> header is my spam trap, so I don't check it very often. You will get a
> quicker response by posting to the newsgroup.
>
>