mapp
01-31-2009, 11:23 AM
Do I need to write an expression (how?) to know the number per day that a person in my database entered a date?
Thanks
Thanks
|
View Full Version : Counting dates in a query mapp 01-31-2009, 11:23 AM Do I need to write an expression (how?) to know the number per day that a person in my database entered a date? Thanks John Big Booty 01-31-2009, 12:01 PM If you open a query in design view, in the top menu bar you will see a button with the Greek letter Sigma (sum), if you click this you will get an additional row in your query grid Total: The default option in this row is Group By, there are numerous other option including Count. This will do exactly what you are looking for. mapp 02-01-2009, 09:42 AM If you open a query in design view, in the top menu bar you will see a button with the Greek letter Sigma (sum), if you click this you will get an additional row in your query grid Total: The default option in this row is Group By, there are numerous other option including Count. This will do exactly what you are looking for. Hi Jhon, Thank you very much. Well, Do you known how can I answer the folllow question: How many person-days have we spent databasing the collection "X" since march 23, 2008 to right now? Do you think taht I need to write an exprsssion, How I do it? Thank you very much. John Big Booty 02-01-2009, 05:03 PM The attached should point you in the right direction. mapp 02-02-2009, 09:46 AM The attached should point you in the right direction. Hi John, Thank you for sent to me some examples. However, I could not to known the answer of the question. May I know your suggestion about the follow attach that I sent you. Probably if you have more elements you are going to tell me more ideas or steps to resolve my question. Again, thanks a lot. Miguel John Big Booty 02-02-2009, 01:07 PM I'm not quite sure what you are looking for. But my suggestion is that you have a look at the structure of the various queries in the DB I posted earlier. mapp 02-02-2009, 01:57 PM I'm not quite sure what you are looking for. But my suggestion is that you have a look at the structure of the various queries in the DB I posted earlier. I will do again. Thank you! p.s. I want to count the number the days, but I can't because the data have same date and I don't idea how those days I can count such as one. Regrads, John Big Booty 02-02-2009, 02:37 PM The DB I posted counts your man hours. From there it should be a simple matter to divide by 24 and come up with Man Days spent by user, by project and total mapp 02-02-2009, 03:06 PM The DB I posted counts your man hours. From there it should be a simple matter to divide by 24 and come up with Man Days spent by user, by project and total I sent you an attach about my situation. I hope you can help me. Let me know if you can see the attach Thanks John Big Booty 02-02-2009, 03:27 PM Sorry I can't read the attachment, it's too small and blurry. Can you post a copy of your DB? Mike375 02-02-2009, 03:29 PM That picture was way too small for me to read and lacked the definition when I made it bigger. Why don't you post the revelant parts of your DB as an attachment. The DB John attached has the basics of how this sort of thing is done and as he said you need to look at how the queries are made. I would suggest that you search and read up on Group By and the associated options such as Max, Count, Min etc. it should be a simple matter to divide by 24 and come up with Man Days spent by user, by project and total Also read up on how to make a calculated field in a query, that is, create another field where the value is based on a calculation such as [FieldName]/24 etc. mapp 02-02-2009, 04:00 PM hi i sent an attach with good quality thanks I want to know how calculate the number per day that each person enetered a specimen. However one date can have several specimenes. Well, i have groups of dates with the same date and when i ran the query this number is continuous but i want to have separated day per day. Thanks. Miguel That picture was way too small for me to read and lacked the definition when I made it bigger. Why don't you post the revelant parts of your DB as an attachment. The DB John attached has the basics of how this sort of thing is done and as he said you need to look at how the queries are made. I would suggest that you search and read up on Group By and the associated options such as Max, Count, Min etc. Also read up on how to make a calculated field in a query, that is, create another field where the value is based on a calculation such as [FieldName]/24 etc. Mike375 02-02-2009, 04:26 PM I want to know how calculate the number per day that each person enetered a specimen. However one date can have several specimenes. Well, i have groups of dates with the same date and when i ran the query this number is continuous but i want to have separated day per day. Thanks. Miguel The attachment is till too hard to read. maybe I need new glasses. You are better to attach the actual data base itself. Do the following. 1) Create a blank DB and import into that DB the parts of your main data base that are relevant to the probem such as the query or queries, table or tables etc. 2) Compact and Repair the new DB. If it is under a few under KB then attach. Otherwise send it to Zip and attach. The Manage Attachments button under where you make your posting will show the maximum size of different types of file. If you want to know how many each person entered then there will need to be a record of each (somewhere) and you will probably be back to Count and Group By. This is why you need to learn up on the basic principles of how this sort of thing is done so you can handle similar issues in the future. mapp 02-02-2009, 05:58 PM Hi everyone, I sent a zip attach. I hope it can be better. Regards The frustred and amateur databasing The attachment is till too hard to read. maybe I need new glasses. You are better to attach the actual data base itself. Do the following. 1) Create a blank DB and import into that DB the parts of your main data base that are relevant to the probem such as the query or queries, table or tables etc. 2) Compact and Repair the new DB. If it is under a few under KB then attach. Otherwise send it to Zip and attach. The Manage Attachments button under where you make your posting will show the maximum size of different types of file. If you want to know how many each person entered then there will need to be a record of each (somewhere) and you will probably be back to Count and Group By. This is why you need to learn up on the basic principles of how this sort of thing is done so you can handle similar issues in the future. Mike375 02-02-2009, 06:29 PM Try a couple of simple things yourself to get the idea. First, make a query and drag down the field that has the person's name onto two fields on the Query Grid. Thus you will see that field twice on the query grid. Now go to the toolbar and click the E and you will see the extra line show for Group By. On the first field leave Group By and on the second field select Count from the drop down list. Now open the query. When you open it you should see each persons name only one and in the Count field will be a number, the number of times they are in the query. To make things easier with the date/time field you have, create a new field and use Lef() to extract the date from what will be a Now() field. This is simple Lef() and do a search on Left() and Instr() Now think about what you what you want to do. If your query is based on all the records then Mary Smith might be there 20 times. However, if the query is restricted by the date then the number of times she will be there will be less etc. To make things simpler to start with you might first make a query that restricts on the date and then query that query for the number of times the person appears. You really have to fiddle with some of this stuff yourself and then when you are done working with it then if it is not working right you post up the DB itself, not pictures but the actual DB. You will fid if you try and do some of this stuff yourself you will learn a lot of other things along the way. For example, learning how to handle Left() and InStr() will prove to be invaulable Hope that gets you going and regards for now. mapp 02-02-2009, 06:50 PM Dear Mike, I appreciated your time to find solution to my problem. I will try to do literally like you wrote. So sorry to sent a image. But I did it because the db is in other computer. Excuse me my dump question, but could you please tell me more about the expressions? Now(), Left() and Instr(). Only I need to write the expressions in the columns and run the query? Regards, Miguel Try a couple of simple things yourself to get the idea. First, make a query and drag down the field that has the person's name onto two fields on the Query Grid. Thus you will see that field twice on the query grid. Now go to the toolbar and click the E and you will see the extra line show for Group By. On the first field leave Group By and on the second field select Count from the drop down list. Now open the query. When you open it you should see each persons name only one and in the Count field will be a number, the number of times they are in the query. To make things easier with the date/time field you have, create a new field and use Lef() to extract the date from what will be a Now() field. This is simple Lef() and do a search on Left() and Instr() Now think about what you what you want to do. If your query is based on all the records then Mary Smith might be there 20 times. However, if the query is restricted by the date then the number of times she will be there will be less etc. To make things simpler to start with you might first make a query that restricts on the date and then query that query for the number of times the person appears. You really have to fiddle with some of this stuff yourself and then when you are done working with it then if it is not working right you post up the DB itself, not pictures but the actual DB. You will fid if you try and do some of this stuff yourself you will learn a lot of other things along the way. For example, learning how to handle Left() and InStr() will prove to be invaulable Hope that gets you going and regards for now. Mike375 02-02-2009, 07:17 PM Dear Mike, Excuse me my dump question, but could you please tell me more about the expressions? Now(), Left() and Instr(). Only I need to write the expressions in the columns and run the query? Now() is for the current time and date. I would srtrongly suggest that you search around on Left and InStr functions and also Mid, Right and Len functions. Both this forum and Google will have a lot of examples. Those functions are all about exrtracting parts of a field. For example, the field where you have date and time those functions can extract either one and place it in another field. But I will have to leave this thread alone now as other things to do and you should have enough now to get you started. As I said, make some attempts on your own, look at the DB John Big Booty posted for you (how the queries were made) and I think you have enough information to have a go at it on your own. mapp 02-02-2009, 07:23 PM Thank you John and Mike! Now() is for the current time and date. I would srtrongly suggest that you search around on Left and InStr functions and also Mid, Right and Len functions. Both this forum and Google will have a lot of examples. Those functions are all about exrtracting parts of a field. For example, the field where you have date and time those functions can extract either one and place it in another field. But I will have to leave this thread alone now as other things to do and you should have enough now to get you started. As I said, make some attempts on your own, look at the DB John Big Booty posted for you (how the queries were made) and I think you have enough information to have a go at it on your own. |