Subject Re: Using Field Named DATE in Where clause
From Maurizio S. <mau@mau.it>
Date Wed, 14 Feb 2024 13:47:25 +0100
Newsgroups dbase.getting-started


Il 14/02/24 13:08, Craig ha scritto:
> In terms of the fieldName being a reserved word. I am trying to get new reports done in the current version of dBase as the original database is from a very early version which only works on Windows XP so the choice was not mine.
>
> Here is the Where clause that I am trying to use:
> where DATE>"(currentDate()-30)" order by DUEDATE, CUSTOMER
>
> This is what I saw online when I tried to look up how to do it
>

assume your table is MYDATA

untested !
query1.sql = 'select field1, field2 where mydata.DATE > :pDate from
MYDATA order by DUEDATE, CUSTOMER'

query1.params['pDate'] = null
query1.active = false // keep closed

then, when you need to get filter, just do:

yourFilter = currentDate() - 30

query1.params['pDate'] = yourFilter
query1.requery()