Re: HELP with DateAdd statement and SQL
From: robnson (stephen_at_ncsquare.com)
Date: 03/02/04
- Next message: Jacques Koorts: "Re: Can one use Option Explicit in COM?"
- Previous message: Bill: "Multidimensional Array (I think)"
- In reply to: Bob Barrows [MVP]: "Re: HELP with DateAdd statement and SQL"
- Next in thread: Bob Barrows [MVP]: "Re: HELP with DateAdd statement and SQL"
- Reply: Bob Barrows [MVP]: "Re: HELP with DateAdd statement and SQL"
- Reply: Dr John Stockton: "Re: HELP with DateAdd statement and SQL"
- Messages sorted by: [ date ] [ thread ]
Date: 2 Mar 2004 09:18:59 -0800
Bob,
Thanks, for you help. Yes, I will need help with converting the time,
and help with adding that to my original script. Here is a sample of
my record in the TimeWritten field. ( 20040122164949.000000-480
)without the (). Also I am new to SQL, but you said just do a update
query and have a new column equal to the TimeWritten column? Again
thank you for all the help.
Steve Robinson
"Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message news:<uVK1KH9$DHA.220@TK2MSFTNGP09.phx.gbl>...
> robnson wrote:
> > Thank you Bob for you help, the datatype is set to char, but the
> > entries comes in with a UTC formatted time stamp. So I need to change
> > this to something else?
> >
> > I am importing event logs into a Database, and the time stamps comes
> > into the database as a UTC formated date and time, so I am trying to
> > take the current date, -1 which will be yesterday, converting that
> > date into a UTC formated Data and put it into my SQL Query as the
> > value in the table is > the converted date.
> >
> > I hope that makes since.
> >
>
> It makes sense, but it is going to be very difficult to achieve: you cannot
> do datetime comparisons with character data without converting the character
> data to datetime. While this may be possible, it will greatly deteriorate
> the performance of any query that you run agains the table, since the
> conversion function will need to be applied to every row in your table.
>
> I strongly suggest that you create a new column with datatype datetime and
> run an update query to set it equal to the date and time stored in your
> TimeWritten column.
>
> Do you need help with converting the UTC entries to datetime? If so, show me
> an example of one of the UTC entries and I'll show you how to do it.
>
> Bob Barrows
- Next message: Jacques Koorts: "Re: Can one use Option Explicit in COM?"
- Previous message: Bill: "Multidimensional Array (I think)"
- In reply to: Bob Barrows [MVP]: "Re: HELP with DateAdd statement and SQL"
- Next in thread: Bob Barrows [MVP]: "Re: HELP with DateAdd statement and SQL"
- Reply: Bob Barrows [MVP]: "Re: HELP with DateAdd statement and SQL"
- Reply: Dr John Stockton: "Re: HELP with DateAdd statement and SQL"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|