Re: tclodbc, SQL Server, date nighmare
- From: Bryan Oakley <oakley@xxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 25 Apr 2007 18:38:35 GMT
lduperval@xxxxxxxxx wrote:
Hi,> db "select uuid from extract where savetime < $date"
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"]
<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
.
- Follow-Ups:
- Re: tclodbc, SQL Server, date nighmare
- From: Laurent Duperval
- Re: tclodbc, SQL Server, date nighmare
- References:
- tclodbc, SQL Server, date nighmare
- From: lduperval
- tclodbc, SQL Server, date nighmare
- Prev by Date: Re: Is there a utility/library proc which print process tree
- Next by Date: Utility for printing process tree
- Previous by thread: tclodbc, SQL Server, date nighmare
- Next by thread: Re: tclodbc, SQL Server, date nighmare
- Index(es):
Relevant Pages
|