Board index » delphi » Filter property with Dates

Filter property with Dates

With a Ttable object I set the filter property to
DataModule4.TBFinOrd.Filter :=i_StoreID='4000' and
v_delDate='12/22/96'
and it works, but I want to change the filter property when
someone clicks on a command button. The code I have in the
command button is similar but not exactly the same. It is :
DataModule4.TBFinOrd.Filter :='i_StoreID=4000 and
v_delDate=12/22/96';  I keep getting an error on the date. It
does not like the way I have it formatted. How do I properly code
the date?

--

 

Re:Filter property with Dates


You have one comma and no two with V_delDate.

Yves TRIN
Paris-France

Re:Filter property with Dates


I think you're problem is in the inverted commas

you have

'i_StoreID=4000 and v_delDate=12/22/96'

try this
'i_StoreID=4000 and v_delDate=''12/22/96'''

You need two single inverted commas when you want delphi to place one in
a string.
e.g. To write out....

John's pint of beer.
in a label you have to assign it like this...
Label1.Caption := 'John''s pint of beer.'

Hope this helps.

John Anderson

Quote
TRAD wrote:
> With a Ttable object I set the filter property to
> DataModule4.TBFinOrd.Filter :=i_StoreID='4000' and
> v_delDate='12/22/96'
> and it works, but I want to change the filter property when
> someone clicks on a command button. The code I have in the
> command button is similar but not exactly the same. It is :
> DataModule4.TBFinOrd.Filter :='i_StoreID=4000 and
> v_delDate=12/22/96';  I keep getting an error on the date. It
> does not like the way I have it formatted. How do I properly code
> the date?

> --

Other Threads