|
Home > Archive > Programming with dBASE > March 2006 > SQL question
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| Charlie Lutz 2006-03-05, 8:27 pm |
| 2.6
table test
field1 cal_year, n, 4, 0
field2 element, c, 3
q.sql = 'select * from test where cal_year = 2005 and element = SWG'
--> error message = invalid field name
I have tried test."element", :alias:test."element"
It works fine if I drop the second part of the where clause (and element
= SWG).
What dumb thing am I doing this time?
Thanks,
Charlie
--
____________________
________
Charlie Lutz
#1000441
| |
| Marc Hamelin 2006-03-05, 8:27 pm |
| Try to put SWG between quotes ('select * from test where cal_year = 2005 and
element = "SWG"').
Marc Hamelin
| |
| Ken Mayer [dBVIPS] 2006-03-05, 8:27 pm |
| Charlie Lutz wrote:
> 2.6
> table test
> field1 cal_year, n, 4, 0
> field2 element, c, 3
>
> q.sql = 'select * from test where cal_year = 2005 and element = SWG'
> --> error message = invalid field name
>
> I have tried test."element", :alias:test."element"
>
> It works fine if I drop the second part of the where clause (and element
> = SWG).
>
> What dumb thing am I doing this time?
Forgetting that "SWG" is a character string. <g> Marc already mentioned
it and the fix, but ...
Ken
--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/
*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/dbase/dBASEBook.htm
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase
| |
| Charlie Lutz 2006-03-06, 7:23 am |
| In article <EImNaTuPGHA.1148@news-server>, m.hamelin@nospam-rasakti.com
says...
> Try to put SWG between quotes ('select * from test where cal_year = 2005 and
> element = "SWG"').
>
> Marc Hamelin
>
Marc, Ken -
Thanks as usual. For some reason SQL and I just can't seem to stay on
the same page. One of these days...
Charlie
--
____________________
________
Charlie Lutz
#1000441
|
|
|
|
|