[AccessD] Rownumbers

Gustav Brock gustav at cactus.dk
Thu Feb 20 09:21:00 CST 2003


Hi Marcel

Oops, somehow an important part of the Where statement in the subquery
got lost: 

  (SELECT
    COUNT(*)
  FROM
    tblOrderDetail AS tblA
  WHERE
  tblA.OR_OD_NUMMER = tblOrderDetail.OR_OD_NUMMER
  AND
  tblA.OR_NUMMER <= tblOrderDetail.OR_NUMMER;) AS RowNo

So, for you:

  ...
  WHERE
    tmpTabel.or_od_nummer = orderregel.or_od_nummer
    AND
    tmpTabel.or_nummer <= orderregel.or_nummer) AS RowNo
  ...
  
/gustav


> Okay, this is as far as I am. This is the query. I have added a fixed
> ordernumber 9798 for testing.

> SELECT orderregel.or_nummer, (select count(*) FROM orderregel AS tmpTabel
> WHERE tmpTabel.or_od_nummer = orderregel.or_od_nummer) AS Expr2
> FROM orderregel
> WHERE (((orderregel.or_od_nummer)=9798));




More information about the AccessD mailing list