tclodbc, SQL Server, date nighmare
- From: lduperval@xxxxxxxxx
- Date: 25 Apr 2007 11:30:58 -0700
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"
I get no results. If I try:
db "select uuid from extract where savetime < '$date'"
I get:
37000 8114 {[Microsoft][ODBC SQL Server Driver][SQL Server]Error
converting data type varchar to numeric.}
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''
The only way to get the proper results is to generate this:
select uuid from extract where savetime < '2005-12-01'
Notice the number of siingle quotes. I tried variations of [list] "",
{}, etc. I can't get the proper syntax. Can anyone help?
L
.
- Follow-Ups:
- Re: tclodbc, SQL Server, date nighmare
- From: Bryan Oakley
- Re: tclodbc, SQL Server, date nighmare
- Prev by Date: Re: c-extension question
- Next by Date: Re: Is there a utility/library proc which print process tree
- Previous by thread: Newby question about colons
- Next by thread: Re: tclodbc, SQL Server, date nighmare
- Index(es):
Relevant Pages
|