Re: HELP with DateAdd statement and SQL
From: robnson (stephen_at_ncsquare.com)
Date: 03/03/04
- Next message: Viatcheslav V. Vassiliev: "Re: VBScript Vs. Javascript"
- Previous message: Peter Christopoulos: "Re: Using ADSystemInfo causes "Class doesn't support Automation" Error"
- In reply to: Bob Barrows [MVP]: "Re: HELP with DateAdd statement and SQL"
- Next in thread: Bob Barrows: "Re: HELP with DateAdd statement and SQL"
- Reply: Bob Barrows: "Re: HELP with DateAdd statement and SQL"
- Messages sorted by: [ date ] [ thread ]
Date: 2 Mar 2004 23:27:59 -0800
I tired everthing you told me but I am still getting an mismatch and
when I put in a actually Date to get coverted, it gives me a error
saying SQL that it is having a problem converting the charater set.
So to go over everyting, I need to first get a date, then convert that
into a UTC time format, then pass that to SQL at the Date?
Thanks,
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: Viatcheslav V. Vassiliev: "Re: VBScript Vs. Javascript"
- Previous message: Peter Christopoulos: "Re: Using ADSystemInfo causes "Class doesn't support Automation" Error"
- In reply to: Bob Barrows [MVP]: "Re: HELP with DateAdd statement and SQL"
- Next in thread: Bob Barrows: "Re: HELP with DateAdd statement and SQL"
- Reply: Bob Barrows: "Re: HELP with DateAdd statement and SQL"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|