Re: tclodbc, SQL Server, date nighmare



lduperval@xxxxxxxxx wrote:
Hi,

I am trying to get a query to work correctly with tclodbc and SQL
Server on WIndows but it systematically fails.

If I try this:

set date [clock format [clock scan [lindex $argv 0]] -format "%Y-%m-
%d"]
> db "select uuid from extract where savetime < $date"
<tale of woe>
The reason is that the first query yields this in SqlServer:

select uuid from extract where savetime < 2005-12-01

and the second one gives

select uuid from extract where savetime < ''2005-12-01''

Have you considered trying the following? (caveat, I've never used tclodbc):

set date "'[clock format ...]'"
db "select uuid from extract where savetime < $date"

In other words, put the single quotes inside the variable $date.

Admittedly, this is just a wild guess on my part.

--
Bryan Oakley
http://www.tclscripting.com
.



Relevant Pages

  • tclodbc, SQL Server, date nighmare
    ... I am trying to get a query to work correctly with tclodbc and SQL ... db "select uuid from extract where savetime < '$date'" ...
    (comp.lang.tcl)
  • Re: Find Specific Record in database Table via VB code
    ... intSearchAtty had been defined as DIM intSearchAtty As Integer and then using ... Programmer Analyst II ... I've attempted to use a macro calling a query to ... >> I'm not sure if I need to use a query to get the record, then extract ...
    (microsoft.public.access.formscoding)
  • Re: MDX very slow
    ... from what I understand, you query your cube to extract all the content of the cube, including leaf level and aggregated content into a CSV file... ... there is a lot of text to extract + a lot a calculations to do. ... I think your users will load this file into another database, so send them only the detailed content and they aggregate as they need, and sending the detail is easy to do with a simple SQL query into your source database. ... > Would it help if I add more aggregations to the cube? ...
    (microsoft.public.sqlserver.olap)
  • Re: Extracting data from web page with an imbedded DB query
    ... I suspect this from the URL in the DB query to get the data. ... my Excel query is no longer able to extract the data ... Is there a way to get Excel to look at the final page and then extract ... I believe that Excel only looks at the HTML, ...
    (microsoft.public.excel.programming)
  • Re: Seperate Notes/Memo field into seperate data fields
    ... ALL of my tools numbers are five characters - some are longer, ... It will extract from your field, ... > but you should be able to do it in the query grid. ...
    (microsoft.public.access.queries)