Re: HELP with DateAdd statement and SQL

From: robnson (stephen_at_ncsquare.com)
Date: 03/03/04


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



Relevant Pages

  • Re: HELP with DateAdd statement and SQL
    ... Yes, I will need help with converting the time, ... query and have a new column equal to the TimeWritten column? ... > do datetime comparisons with character data without converting the character ...
    (microsoft.public.scripting.vbscript)
  • Re: Typed Dataset: Add expression-based column?
    ... Could you provide more clarity regarding how I would combine the datetime ... Microsoft MVP in VC++ ... Why this over the SQL select query that merges the two fields? ... "Conversion failed when converting datetime from character string" ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Typed Dataset: Add expression-based column?
    ... Why this over the SQL select query that merges the two fields? ... datetime field), I get an error at runtime complaining of a problem ... "Conversion failed when converting datetime from character string" ...
    (microsoft.public.dotnet.framework.adonet)
  • RE: why this wont work!!??
    ... is used when evaluating the WHERE clause in the query to ... eliminate records that aren't included in the requested data set. ... > That's way I have used a subquery to avoid converting data like 'c*' ...
    (microsoft.public.access.queries)
  • Re: Calculate time lapsed between two records
    ... Dear Tom: ... The DateTime field is not blank. ... When I tried it with alias table technique referring to the same tbltest1 as ... > I believe you will need to run this query based solely on the table in which ...
    (microsoft.public.access.queries)

Loading