Subject | Re: [IBO] Parameter looses value on reorder |
---|---|
Author | Helen Borrie |
Post date | 2002-11-09T08:12:20Z |
At 08:50 AM 09-11-02 +0100, you wrote:
This should be
DM.qryBestell.Params.ByName('Datum').AsDate := dtpBestellDatum.Date;
or
DM.qryBestell.Params.ByName('Datum').AsDateTime
:= dtpBestellDatum.DateTime;
(depending on the data type of the database column). If it is a Timestamp
in the database then you need to use the DateTime properties and change
your where clause to
WHERE BestDatum > :Datum
AND BestDatum < :Datum + 1
See if this solves your problem. If not, come back to the list.
Helen
>Helen,Date types are not strings.
>
> > What exactly do you mean by "whenever the grid is reordered". What
> > are you doing in order to "reorder the grid"? (In IBO, you don't
> > reorder the grid, you reorder the dataset...)
>
>The query is a detail of a master (tabKunden). The master displays
>customers, in the detail I display what they have ordered on a given
>date. There is a subselect in the detail query to have a combobox
>in the grid.
>This is the complete SQL of the detail:
>
>Select BestID
> , BestNr
> , BestEtikettNr
> , ArtID
> , KdnID
> , BestAnzahl
> , (Select ArtBezeichner from tabArtikel
> where tabArtikel.ArtID=tabBestell.ArtID)
> AS Artikel
> , BestBemerkung
> , BestDatum
> , BestBezahlt
> , BestDrucken
> >From tabBestell
>Where BestDatum = :Datum
>
>"BestID" is a generated value I have in KeyLinks, in GeneratorLinks there is
>"tabBestell.BestID=GEN_tabBestell", in MasterLinks there is
>"tabBestell.KdnID=tabKunden.KdnID"
>
>"Datum" is set once upon startup of the application and whenever the user
>selects a different date with a DatTimePicker, this is how it's set:
>DM.qryBestell.Params.ByName('Datum').AsString
>:=DateToStr(dtpBestellDatum.Date);
This should be
DM.qryBestell.Params.ByName('Datum').AsDate := dtpBestellDatum.Date;
or
DM.qryBestell.Params.ByName('Datum').AsDateTime
:= dtpBestellDatum.DateTime;
(depending on the data type of the database column). If it is a Timestamp
in the database then you need to use the DateTime properties and change
your where clause to
WHERE BestDatum > :Datum
AND BestDatum < :Datum + 1
See if this solves your problem. If not, come back to the list.
Helen