Subject Re: Query error
From Tom <IHaveNoEmail@ddress>
Date Sat, 2 Sep 2023 09:18:19 -0400
Newsgroups dbase.getting-started
Attachment(s) DemoData.png

On 9/2/23 8:32 AM, Mervyn Bick wrote:
> On 2023/09/02 14:04, Tom wrote:
>
>> Sorry Mervyn but I am still confused here. The following 'cut down'
>> version still has the 'invalid field name' error. Trying to get this
>> to work correctly then I can add back the rest of my original query.
>>
>> Revision2:
>> *
>>
>> sql = "Select CAST(d.TestDate as Char(10)) Test_Date, d.TestDate,
>> d.Provider, d.Client, d.Category, d.Allergen, d.TestLevel,
>> d.StdTestRange, n.Demodata_Notes FROM DemoData d Left Join DemoNotes n
>> On n.Fk_DemoData = d.Pk_DemoData WHERE Test_Date LIKE :TestDate"
>> *
>> params["TestDate"] = "%"
>
> This error message usually means there is a typo in one of the field
> names.  If you've checked the fieldname spelling and the problem still
> persists then I'm afraid it's a process of elimination.  Start from
> scratch and add a field at a time.
>
> sql = "select CAST(d.TestDate as char(10) Test_Date from Demodata d
> WHERE Test_date LIKE :TestDate"
>
> sql = "select CAST(d.TestDate as char(10) Test_Date,d.TestDate from
> Demodata d WHERE Test_date LIKE :TestDate"
>
> sql = "select CAST(d.TestDate as char(10)
> Test_Date,d.TestDate,d.Provider from Demodata d WHERE Test_date LIKE
> :TestDate"
>
> and so on.
>
>
> Mervyn.
>
Revision3:
*
sql = "select CAST(d.TestDate as char(10)) Test_Date from Demodata d
WHERE Test_date LIKE :TestDate"

// Note: above query is a verbatim copy of your first sql above with
close ')' included. Same error message.
*
params["TestDate"] = '%'

Picture of table design attached. I do not see any field name spelling
errors.

Tom