kidrobot
06-25-2007, 04:48 AM
How can I add a field that just populates "1" for each record so I can do a count. I know I can count based on a specific field but my boss wants to see a field that just shows "1" so I can SUM it up in another query.
|
View Full Version : add a field to count kidrobot 06-25-2007, 04:48 AM How can I add a field that just populates "1" for each record so I can do a count. I know I can count based on a specific field but my boss wants to see a field that just shows "1" so I can SUM it up in another query. chergh 06-25-2007, 06:11 AM Tell your boss he is an idiot and what he wants you to do is absurd. chergh 06-25-2007, 06:15 AM If you really want to do it open your table in design mode, add a column and set the default value to 1. kidrobot 06-25-2007, 06:18 AM Tell your boss he is an idiot and what he wants you to do is absurd. lol... he is going to be maintaining this database after I leave and he is used to counting his records like this. So if I can do this in a query let me know!! Brianwarnock 06-25-2007, 06:22 AM Surely it is simpler to just put CountofRecords: Count(*) in the query grid? Brian chergh 06-25-2007, 06:43 AM lol... he is going to be maintaining this database after I leave and he is used to counting his records like this. So if I can do this in a query let me know!! You can add the column using the query but, AFAIK, you can't set a default value. Instead of doing this spend 15 minutes explaining to your boss how he can get a count without a column full of ones. The_Doc_Man 06-25-2007, 06:13 PM 1. Open EXCEL Help. 2. Find the section on functions. 3. Print the help on the SUM function. 4. Now print the help on the COUNT function. 5. Explain to the chowderhead that even EXCEL doesn't need a SUM all of the time. 6. Immediately leave the room just in case his brain explodes from having too much data in it at one time. 7. As a precaution, the day you are going to do this... wear older clothes in case his brain-burst involves a large splatter factor. Michael J Ross 06-25-2007, 11:15 PM How can I add a field that just populates "1" for each record so I can do a count. I know I can count based on a specific field but my boss wants to see a field that just shows "1" so I can SUM it up in another query. If you really must add a column to your query like the following, it will append 1 as a field to each record COUNT:1 neileg 06-26-2007, 12:20 AM If you really must add a column to your query like the following, it will append 1 as a field to each record COUNT:1Erm, Michael, isn't COUNT a reserved word? Michael J Ross 06-26-2007, 12:54 AM Yep :) , use something like RECCOUNT:1 |