Board index » delphi » SQL statements don't accept "/"

SQL statements don't accept "/"

Hi, Everybody:

   When I put something below to SQL property of TQuery,
         Select  grt/prog, id , sdept From tableX
         where  ______
    It does't recognize "/" of the field grt/prog, what should I do?

Jing

 

Re:SQL statements don't accept "/"


Quote
Jing-Z...@UIOWA.EDU (Jing Zhou) wrote:
> Hi, Everybody:

>    When I put something below to SQL property of TQuery,
>          Select  grt/prog, id , sdept From tableX
>          where  ______
>     It does't recognize "/" of the field grt/prog, what should I do?

> Jing

Are you saying you can't get the result of the division
(with a FieldByName)?  Try something like this:

   Select  grt/prog RESULT, id , sdept From tableX
   where  ______

then you could do :

   res := TQuery.FieldByName('result').AsInteger;

or something similar.  Essentially, you're defining
a name for the column.

Hope I answered the right question :)

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Chris Kasten
Programmer/Analyst

#include <std/disclaimer.h>
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Re:SQL statements don't accept "/"


Quote
In article <31489f86.8648...@news.brookings.net> kas...@brookings.net (Chris Kasten) writes:
>Path:
>news.uiowa.edu!news.physics.uiowa.edu!math.ohio-state.edu!uwm.edu!spool.mu.edu!h
>owland.reston.ans.net!newsfeed.internetmci.com!news.pe.net!news.corpcomm.net!dki
>rk
>From: kas...@brookings.net (Chris Kasten)
>Newsgroups: comp.lang.pascal.delphi.databases
>Subject: Re: SQL statements don't accept "/"
>Date: Thu, 14 Mar 1996 22:40:34 GMT
>Organization: Corporate Communications
>Lines: 37
>Message-ID: <31489f86.8648...@news.brookings.net>
>References: <Jing-Zhou.35.31489...@UIOWA.EDU>
>NNTP-Posting-Host: m17.brookings.net
>X-Newsreader: Forte Agent .99d/32.182

Sorry, Chris.  I might not express the question clearly last time.
the whole field name is "grt/prog", it says can't find field
"grt"?  It may take "/" as division symbol rather than a
character in the field.

Jing

Quote
>Jing-Z...@UIOWA.EDU (Jing Zhou) wrote:
>> Hi, Everybody:

>>    When I put something below to SQL property of TQuery,
>>          Select  grt/prog, id , sdept From tableX
>>          where  ______
>>     It does't recognize "/" of the field grt/prog, what should I do?

>> Jing

>Are you saying you can't get the result of the division
>(with a FieldByName)?  Try something like this:
>   Select  grt/prog RESULT, id , sdept From tableX
>   where  ______
>then you could do :
>   res := TQuery.FieldByName('result').AsInteger;
>or something similar.  Essentially, you're defining
>a name for the column.
>Hope I answered the right question :)
>-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
>Chris Kasten
>Programmer/Analyst
>#include <std/disclaimer.h>
>=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Other Threads