Results 1 to 9 of 9
  1. #1
    Join Date
    Nov 2003
    Location
    uk
    Posts
    47

    Unanswered: help on counting in a query

    am creating a query that counts different parts, is it possible count the different lines as a running total from 10000. So that the first lines has 10000 and then next line has 10001 and so forth till the end of the query:
    I am using an expression within the designer -- Line No: "10000"


    What i have currently have:

    PNO line No

    1a 10000
    2a 10000
    3a 10000

    What i need:

    PNO line No

    1a 10000
    2a 10001
    3a 10002

    thanks dave

  2. #2
    Join Date
    Feb 2004
    Posts
    199
    Thats too dificult via Query in MS Access
    you need same table vith alias joined to himself via pk
    tblalias1.pk < tblalias2.pk and then groupin and agregate function count
    MDB, ADP <-> MS SQL + VBA, ADO & RDO, .NET, Oracle, Java/Jsp.

  3. #3
    Join Date
    Feb 2004
    Posts
    199
    but in reports it's very easy
    MDB, ADP <-> MS SQL + VBA, ADO & RDO, .NET, Oracle, Java/Jsp.

  4. #4
    Join Date
    Nov 2003
    Location
    uk
    Posts
    47
    thx 4 the reply, i need it in a query as i am going to export the data from it.Can i export data from a report in txt format?

  5. #5
    Join Date
    Feb 2004
    Posts
    199
    write down your table's structure and I'll show you the query u need.
    MDB, ADP <-> MS SQL + VBA, ADO & RDO, .NET, Oracle, Java/Jsp.

  6. #6
    Join Date
    Nov 2003
    Location
    uk
    Posts
    47
    Date

  7. #7
    Join Date
    Feb 2004
    Posts
    199
    Date - then? nothing more, I need table's structure
    MDB, ADP <-> MS SQL + VBA, ADO & RDO, .NET, Oracle, Java/Jsp.

  8. #8
    Join Date
    Nov 2003
    Location
    uk
    Posts
    47
    whoops ill try again...............

    This is the table


    date -- typeof entry -- partno -- job no -- location -- good parts --
    ---------------------------------------------------------------------------
    1/1/03 positive p1 5037 FG 31313
    1/1/03 positive p2 5037 FG 34523
    1/1/03 positive p3 5037 FG 32343
    1/1/03 positive p4 5037 FG 32383



    the query:thats how i would like it

    date -- typeof entry -- partno -- job no -- location -- good parts -- line no
    ------------------------------------------------------------------------------------
    1/1/03 positive p1 5037 FG 31313 10000
    1/1/03 positive p2 5037 FG 34523 10001
    1/1/03 positive p3 5037 FG 32343 10002
    1/1/03 positive p4 5037 FG 32383 10003



    thahts what ive got:
    date -- typeof entry -- partno -- job no -- location -- good parts -- line no
    ------------------------------------------------------------------------------------
    1/1/03 positive p1 5037 FG 31313 10000
    1/1/03 positive p2 5037 FG 34523 10000
    1/1/03 positive p3 5037 FG 32343 20000
    1/1/03 positive p4 5037 FG 32383 20000

    im using an count on a expression


    thanks dave

  9. #9
    Join Date
    Feb 2004
    Posts
    199
    you need an unique field to sort & number records, oterwise you can't do it via query, which field is unique in your table, do you have a primary key in your table?
    you should somehow sort your table to number it. so you need a field to sort by, and this field shoulb be unique.
    Last edited by Kakha; 02-12-04 at 11:55.
    MDB, ADP <-> MS SQL + VBA, ADO & RDO, .NET, Oracle, Java/Jsp.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •