i need to count the number of entries in a table and import it into a single cell in another table, any ideas?
i need to count the number of entries in a table and import it into a single cell in another table, any ideas?
Normally this wouldn't be something that would be beat practices. You normally would have some value that would could be used to break it down to any unit of measurementthT you'd like. For example a datetime value. This way you can see how many records are created every hour or every day or every week as you would lke without the need to store the value. You can simply calculate it from a query and it will break it down for you.
If this is what you're looking for,
select count(*) as results from <tablename>
where datefieldname between #startdate# to #enddate#
ill explain it in more detail before i attempt to use code (im not good at code haha)
basically ive got tables for types of equipment such as 'displays' which is one table and 'pagers' which is another table
ive then got another table for total equipment that has fields of 'number of pagers' and 'number of displays', instead of typing these numbers i want them imported by counting the entries from the other tables if thats possible
is that how you understood it?
Hey vCallNSPF:ill explain it in more detail before i attempt to use code (im not good at code haha)
basically ive got tables for types of equipment such as 'displays' which is one table and 'pagers' which is another table
ive then got another table for total equipment that has fields of 'number of pagers' and 'number of displays', instead of typing these numbers i want them imported by counting the entries from the other tables if thats possible
is that how you understood it?
Since i didn't have that level of understanding before, that kind of clears up the issue a little bit for me.
If you have separate table of each type of equipment that you have, that's going to be a great deal of tables that you're going to have to count.
the but example of how to count the number of records is:
that is the simplist.Code:SELECT COUNT(*) as Pagers FROM tablename
If you want to insert that into another table:
These are queries that you can run to do what you're talking about.Code:INSERT INTO TableNameThatHoldsCounts.FieldName SELECT COUNT(*) FROM TableNameToBeCounted
If you have any more questions, please let me know,
Joe P.
i have a query that shows the total entries in 4 different tables.
eg.
displays: 4
repeaters: 6
nodes: 3
receivers: 2
okay, now when ive set it up it only counts the highest number and puts that as the value for all four.
so it will come up as
displays: 6
repeaters: 6
nodes: 6
receivers: 6
because repeaters is the highest amount, how do i set it up this is displayed correctly
Solved
For some reason you cant create a query that counts all the fields from several different tables because they get mixed up. (well i couldnt find a way)
so i made a query for each of the counts and brought each of those into a report in the form of a subreport and that worked