473,326 Members | 2,815 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Counting number of records

In an access form I need to count number of records in the running month. Otherwise I need increamental number in a field mentioning serial number. First day of the month first sample should be 1 then 2nd sample 2 like that.
How can I do this. Can I use the following expression. If yes how can I modify for first day of the month and current date.

DCount("[SAMPLE ID]", "SAMPLE LOG BOOK", _
"[Date]Between #21-Jun-2007# And #22-Jun-2007#")
Aug 2 '07 #1
1 1700
ADezii
8,834 Expert 8TB
In an access form I need to count number of records in the running month. Otherwise I need increamental number in a field mentioning serial number. First day of the month first sample should be 1 then 2nd sample 2 like that.
How can I do this. Can I use the following expression. If yes how can I modify for first day of the month and current date.

DCount("[SAMPLE ID]", "SAMPLE LOG BOOK", _
"[Date]Between #21-Jun-2007# And #22-Jun-2007#")
The following code will return a Count of the number of Records from the 1st day of the Month to the Current Date. This is my interpretation of a Running Total for the Month.
Expand|Select|Wrap|Line Numbers
  1. MsgBox DCount("[SAMPLE ID]", "SAMPLE LOG BOOK", "[Date] BETWEEN " & _
  2.               "#" & Month(Now) & "/1/" & Year(Now) & "#" & " And Now()")
Aug 7 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Reply via newsgroup | last post by:
Folks, When performing an update in mysql (using PHP), can I find out how many records were matched? mysql_affected_rows() won't work... and I have the following problem that I thought I...
7
by: C White | last post by:
A little while back I had a question about counting records and my example was something like this: in my database table i have the following records john ed john rick tom
2
by: N. Graves | last post by:
I have a table with records of games played with a field for players name and another fields is a "WinorLose". One player may play several games to complete a match. I want my report to tell me...
5
by: chrisc | last post by:
Hello, Hope this is the right place for this... I am creating a testing database for components as they come off a production line. My reports need to select faults that are found, as well...
5
by: ChadDiesel | last post by:
Hello Again, I want to assign a number to each record that will be part of a shipping number. I want the number value to count up until the contract number changes. Then, I want the number to...
18
by: ChadDiesel | last post by:
I appreciate the help on this group. I know I've posted a lot here the last couple of weeks, but I was thrown into a database project at my work with very little Access experience. No other...
9
by: GeRmIc | last post by:
Hi, I receive an XML string like <record> <value>...</value> </record> <record> <value>...</value> </record>....... etc.,
8
by: johnds | last post by:
This is my third question about eliminating accounting entries in a clinical database, yet retaining the valid record. Latest wrinkle is being able to sum the visits to the doctor, and the units of...
0
by: Chia Lee Lee | last post by:
Hello… I have problem when counting the number of records, which is based on the start date and end date. I have tried to use message box to prompt the result, but the result given is...
8
by: crassostrea | last post by:
Hello and Happy New Year, I have two tables in Access 2003 (Windows XP) with similar, but different, information. We’ll call them table A and table B. I want to count the number of records in...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.