Re: (Excel & ODBC) Howto compare string and datetime????

From: Dmitri Ivanov (divanov_NOSP_at_M_.aha.ru)
Date: 05/14/04


Date: Fri, 14 May 2004 21:54:08 +0400

Hello Jorch,
"Jorch" <jorchrock_1@hotmail.com> wrote:

J> How can I compare string (let's say '2004-12-31 12:00:00') and
J> datetime (or timestamp or whatever odbc calls it)????
J>
J> With PostgreSQL I can do it like (dateCol type is timestamp)
J>
J> SELECT dateCol FROM table
J> WHERE dateCol = '2004-12-31 12:00:00'::timestamp

Please use escape syntax in SQL sentences for timestamp values, e.g.
    {ts '2004-12-31 12:00:00'}

J> Is there possibilities to cast types (from datetime to text)
J> to another in Excel file ODBC driver???

For fetching, you could bind the datatime column as SQL_C_CHAR. The driver
will deliver the column values as text.

--
Sincerely,
Dmitri Ivanov
Common Lisp ODBC interface - www.ystok.ru


Relevant Pages

  • Re: (Excel & ODBC) Howto compare string and datetime????
    ... >J> With PostgreSQL I can do it like (dateCol type is timestamp) ... >J> Is there possibilities to cast types (from datetime to text) ... >J> to another in Excel file ODBC driver??? ...
    (microsoft.public.data.odbc)
  • (Excel & ODBC) Howto compare string and datetime????
    ... This really should be very simple but howto do this with Excel file ... ODBC driver and SQL language... ... With PostgreSQL I can do it like (dateCol type is timestamp) ... Is there possibilities to cast types (from datetime to text) to ...
    (microsoft.public.data.odbc)
  • Re: Please advise on approach
    ... has direct bearing on the issues and the context is difficult to communicate ... > of the term timestamp - it does not refer to the sql data type in this ... rather to the datetime at which the source produced the data - ... I'm only interested in it differentiating between records ...
    (microsoft.public.sqlserver.server)
  • Re: Convert help needed desperately
    ... overflow error converting expression to data type datetime. ... Is my sql server hosed???? ... > the timestamp data type. ...
    (microsoft.public.sqlserver.programming)
  • Re: Python 2.3 ODBC Datetime limitations
    ... Has any of you ever used Python odbc to retrieve data from a relational DB? ... The epoch is the point where the time starts. ... So this may not be a problem with the odbc module, which isn't the most up-to-date piece of software on the block but is mostly reliable for simple purposes. ... I'd try something from the datetime module. ...
    (comp.lang.python)

Quantcast