Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Query numbering in groups in access database ?

Query numbering in groups in access database ?

Scheduled Pinned Locked Moved Database
databasesql-servercomsysadminhelp
4 Posts 2 Posters 6 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 2456424
    wrote on last edited by
    #1

    in sql server there is a group problem statement: DENSE_RANK() OVER (ORDER BY TABLUONGNV3.HOVATEN) AS STT How to write in sql access issues in groups? I'm not writing well: (Select Count (*) FROM [TABLUONGNV3] as Temp WHERE [Temp].[MANHANVIEN] < [TABLUONGNV3].[MANHANVIEN]) + 1 AS STT

    SELECT (Select Count (*) FROM [TABLUONGNV3] as Temp WHERE [Temp].[MANHANVIEN] < [TABLUONGNV3].[MANHANVIEN]) + 1 AS STT, TABLUONGNV3.HOVATEN, TABNHANVIEN.IDNV, TABLUONGNV3.MACANV, TABNHANVIENCA.CANV, TABLUONGNV3.N01, TABLUONGNV3.N02, TABLUONGNV3.N03, TABLUONGNV3.N04, TABLUONGNV3.N05, TABLUONGNV3.N06, TABLUONGNV3.N07, TABLUONGNV3.N08, TABLUONGNV3.N09, TABLUONGNV3.N10, TABLUONGNV3.N11, TABLUONGNV3.N12, TABLUONGNV3.N13, TABLUONGNV3.N14, TABLUONGNV3.N15, TABLUONGNV3.N16, TABLUONGNV3.N17, TABLUONGNV3.N18, TABLUONGNV3.N19, TABLUONGNV3.N20, TABLUONGNV3.N21, TABLUONGNV3.N22, TABLUONGNV3.N23, TABLUONGNV3.N24, TABLUONGNV3.N25, TABLUONGNV3.N26, TABLUONGNV3.N27, TABLUONGNV3.N28, TABLUONGNV3.N29, TABLUONGNV3.N30, TABLUONGNV3.N31, TABNHANVIENCA.TIENMOTCA, TABLUONGNV3.TONGLUONG, TABLUONGNV3.PHAT, TABLUONGNV3.TAMUNG, TABLUONGNV3.THUCNHAN, TABLUONGNV3.GHICHU
    FROM TABNHANVIENCA INNER JOIN (TABNHANVIEN INNER JOIN TABLUONGNV3 ON TABNHANVIEN.IDNV = TABLUONGNV3.MANHANVIEN) ON TABNHANVIENCA.IDCANV = TABLUONGNV3.MACANV
    WHERE TABLUONGNV3.LUONGTHANG = #06/01/2019#
    ORDER BY TABLUONGNV3.HOVATEN;

    You see the attached file: http://www.mediafire.com/file/pajlr19fwde8r9l/Query\_numbering.xls/file

    CHill60C 1 Reply Last reply
    0
    • U User 2456424

      in sql server there is a group problem statement: DENSE_RANK() OVER (ORDER BY TABLUONGNV3.HOVATEN) AS STT How to write in sql access issues in groups? I'm not writing well: (Select Count (*) FROM [TABLUONGNV3] as Temp WHERE [Temp].[MANHANVIEN] < [TABLUONGNV3].[MANHANVIEN]) + 1 AS STT

      SELECT (Select Count (*) FROM [TABLUONGNV3] as Temp WHERE [Temp].[MANHANVIEN] < [TABLUONGNV3].[MANHANVIEN]) + 1 AS STT, TABLUONGNV3.HOVATEN, TABNHANVIEN.IDNV, TABLUONGNV3.MACANV, TABNHANVIENCA.CANV, TABLUONGNV3.N01, TABLUONGNV3.N02, TABLUONGNV3.N03, TABLUONGNV3.N04, TABLUONGNV3.N05, TABLUONGNV3.N06, TABLUONGNV3.N07, TABLUONGNV3.N08, TABLUONGNV3.N09, TABLUONGNV3.N10, TABLUONGNV3.N11, TABLUONGNV3.N12, TABLUONGNV3.N13, TABLUONGNV3.N14, TABLUONGNV3.N15, TABLUONGNV3.N16, TABLUONGNV3.N17, TABLUONGNV3.N18, TABLUONGNV3.N19, TABLUONGNV3.N20, TABLUONGNV3.N21, TABLUONGNV3.N22, TABLUONGNV3.N23, TABLUONGNV3.N24, TABLUONGNV3.N25, TABLUONGNV3.N26, TABLUONGNV3.N27, TABLUONGNV3.N28, TABLUONGNV3.N29, TABLUONGNV3.N30, TABLUONGNV3.N31, TABNHANVIENCA.TIENMOTCA, TABLUONGNV3.TONGLUONG, TABLUONGNV3.PHAT, TABLUONGNV3.TAMUNG, TABLUONGNV3.THUCNHAN, TABLUONGNV3.GHICHU
      FROM TABNHANVIENCA INNER JOIN (TABNHANVIEN INNER JOIN TABLUONGNV3 ON TABNHANVIEN.IDNV = TABLUONGNV3.MANHANVIEN) ON TABNHANVIENCA.IDCANV = TABLUONGNV3.MACANV
      WHERE TABLUONGNV3.LUONGTHANG = #06/01/2019#
      ORDER BY TABLUONGNV3.HOVATEN;

      You see the attached file: http://www.mediafire.com/file/pajlr19fwde8r9l/Query\_numbering.xls/file

      CHill60C Offline
      CHill60C Offline
      CHill60
      wrote on last edited by
      #2

      As you are not explaining this very well try the following: 1. Simplify your query down to the bare bones to demonstrate your problem e.g. remove all but one of the columns from TABLUONGNV3 from the select. 2. Supply us with some sample data for each of the tables left in your simplified query 3. Provide the results that you expect from the sample data provided. Don't link to files - we won't download them, besides mediafire is a blocked site on my work computer.

      U 1 Reply Last reply
      0
      • CHill60C CHill60

        As you are not explaining this very well try the following: 1. Simplify your query down to the bare bones to demonstrate your problem e.g. remove all but one of the columns from TABLUONGNV3 from the select. 2. Supply us with some sample data for each of the tables left in your simplified query 3. Provide the results that you expect from the sample data provided. Don't link to files - we won't download them, besides mediafire is a blocked site on my work computer.

        U Offline
        U Offline
        User 2456424
        wrote on last edited by
        #3

        This site has no support for sending attachments, so I use mediafire to send attachments, if your computer is blocked you can bypass the firewall using psiphon3.exe software, you can download this software at address [Download Psiphon 3 for PC Windows 7/8/8.1/10 or XP Laptops](https://brighterhq.com/download-psiphon-for-pc-laptop-windows#Psiphon\_3\_Download) Soon receive your feedback

        CHill60C 1 Reply Last reply
        0
        • U User 2456424

          This site has no support for sending attachments, so I use mediafire to send attachments, if your computer is blocked you can bypass the firewall using psiphon3.exe software, you can download this software at address [Download Psiphon 3 for PC Windows 7/8/8.1/10 or XP Laptops](https://brighterhq.com/download-psiphon-for-pc-laptop-windows#Psiphon\_3\_Download) Soon receive your feedback

          CHill60C Offline
          CHill60C Offline
          CHill60
          wrote on last edited by
          #4

          No - I cannot bypass the firewall using some dodgy download. What makes you think our corporate security is so weak it would allow me to do that :laugh: Why not just do what thousands of other members do - type in the details into a post?

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups