14. maj 2001 - 11:55Der er
7 kommentarer og 1 løsning
Jeg er på herrens mark
Jeg skal have access til at sammenligne 2 poster i en formular, når følgende betingelser er opfyldt: feltet [batchnr] er identisk, feltet [dato] er identisk.
det der skal sammenlignes er feltet [vand]. hvis access finder at differencen er >0,4 skal feltet[difference] være = * ellers = null
I dette særtema ser vi på, hvordan cloud og AI bliver fundamentet for virksomhedernes digitale forretning, og hvordan de nye muligheder for automatisering og forretningsværdi kan udnyttes uden at miste overblik, sikkerhed og menneskelig kontrol.
can you give a bit more information? When you say \"2 poster\" do you mean that there are two records in the detail, and if that is correct can there be more than the two records?
i want to compare 2 records in a form; if [batchnr] and [date] are identical in both records, access is to compare the fields [vand] and if the difference is >0.4 the field [difference] = * else = null
n_riber, I think your problem is more complicated than the 30 points suggests. If I understand you correctly there are a number of records on the form. Each record has to be compared to the others and if another has the same [batchnr] and [dato] then you want to set the [difference]field to * otherwise null.
So from this I can assume that there can be more than two records where these fields are the same, is this not correct?
the records are ONLY to be compared if they havethe same [batchnr] AND same[date]. then if the difference between record1.[vand] and record2.[vand] is larger than 0.4 record2.[difference]= * otherwise= null.
each day there is 2 records with the same [batchnr].
I assume that the [difference] field is also a field in the table. If so then I suggest that you run an update query to set the [difference] field in the table to either \"*\" or null, when you open the form. If the field isnt bound to the table then you could set it by using the iif() and the dcount() functions. the iif is like an IF and the dcount will return the number of records where your criteria is true. IE if Dcount > 1 then difference = * else null. The synax may take a bit of playing around with but for 30 points hope this gives you an idea...
Hi Niels Is it my English you dont understand or the answer?
But then if you have solved the problem then you get the points!
Terry
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.