sql capability not supported error 
Author Message
 sql capability not supported error

i'm trying to do a sql query listing all of the records that match today's
date.

query1.sql.add('select tickler."date", tickler."name key" from tickler where
datetostr(tickler."date") = "today"');

i get an error, capability not supported or invalid use of 'date'.  i think
part of the problem is that when this database was designed the field name
'date' was used which is also a function.  the tickler."date" should make it
clear it's not a function.  is it another problem?  'today' is a string of
date(now).  the date is in the database as 11/9/97 format. does anyone know
what's wrong with the above code?

please reply by e-mail and post,
darrin



Wed, 18 Jun 1902 08:00:00 GMT  
 sql capability not supported error

I'm not an SQL master, but is DateToStr supported (in that format anyway).  Try
 this:

query1.sql.add('select tickler."date", tickler."name key" from tickler where "'
 + tickler.fieldbyname('date').AsString+'" = "today"');

Also, is "today" a valid SQL keyword?  If so, it probably should be in quotes.
 If not, try   ...  "' + DateToStr(Date) + '"'

Hope this helps.
M. Scott St.Cyr
Cyrious Software, Inc.
//***************************************************************//



Wed, 18 Jun 1902 08:00:00 GMT  
 sql capability not supported error

Hi

When using reserved word try using Paramters.

Regards
Leslie Drewery



Quote:
> i'm trying to do a sql query listing all of the records that match
today's
> date.

> query1.sql.add('select tickler."date", tickler."name key" from tickler
where
> datetostr(tickler."date") = "today"');

> i get an error, capability not supported or invalid use of 'date'.  i
think
> part of the problem is that when this database was designed the field
name
> 'date' was used which is also a function.  the tickler."date" should make
it
> clear it's not a function.  is it another problem?  'today' is a string
of
> date(now).  the date is in the database as 11/9/97 format. does anyone
know
> what's wrong with the above code?

> please reply by e-mail and post,
> darrin



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. SQL error - capability not supported...Why ?

2. Capability Not Supported Error

3. Error: 'Capability not supported'

4. A Query and Capability not supported error

5. SQL capability not supported

6. TQuery SQL statement "Capability Not Supported"

7. Capability Not supported.....why not?

8. capability not supported

9. capability not supported

10. Capability Not Supported, Delphi 4, Oracle 8

11. "capability not supported" w/MSAccess DB

12. Capability not supported - runtime only???

 

 
Powered by phpBB® Forum Software