473,386 Members | 1,621 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,386 software developers and data experts.

Help with multiple criteria DCount and Date Field

27
I am trying to use the following code, but I think there is an error in my syntax:

Count = DCount("[Status In]", "Change Dates", "[Status In] = '" & [Forms]![Main]![New] & "' AND CVDate(Int( #" & [Date] & "# )) = #" & (Date) & "#")

I believe that this is the particular problem area:

CVDate(Int( #" & [Date] & "# ))

I've been messing with this for awhile now and it's just not working properly.

I'm trying to count the number of occurences in the [Status In] field within "Change Dates" where the [Status In] field within "Change dates" is a particular value on the form and the [Date] field within "Change Dates" is the current date.
Dec 12 '06 #1
3 9240
MMcCarthy
14,534 Expert Mod 8TB
Will the following not work ...

Expand|Select|Wrap|Line Numbers
  1. Count = DCount("[Status In]", "Change Dates", "[Status In] = '" & [Forms]![Main]![New] & "' AND [Date] = Date()")
  2.  
Mary
Dec 12 '06 #2
psuaudi
27
That was actually my first course of action, but unfortunately it will not work because the [Date] field has the date stored in it as a general date (date and time) format, but I only care about comparing it to the current day. I've used the CVDate(Int([Date])) code elsewhere to parse only the date from the field, but in this instance it does not seem to want to work.

Thank you for the reply!
Dec 13 '06 #3
psuaudi
27
Nevermind, I finally got it to work. I swear I had tried this syntax yesterday and it didn't want to work...but this is what I ended up with.

Count = DCount("[Status In]", "Change Dates", "[Status In] = '" & [Forms]![Main]![New] & "' AND CVDate(Int([Date])) = Date()")

Thank you!
Dec 13 '06 #4

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

Similar topics

7
by: jdph40 | last post by:
I posted this problem previously and received excellent help from Wayne Morgan. However, I still have an unanswered question. My form (frmVacationWeeks) is opened from the OnClick event of a...
1
by: Dan Leeder | last post by:
stroccur = DCount("", "empnotes", " = " & Chr(34) & Me.Rpt_Card_Type & Chr(34) & " And = " & Me.SSN & " And #" & & "# > " & DateSerial(Year(Me.datetime) - 1, Month(Me.datetime),...
2
by: Susan Bricker | last post by:
Greetings. Before I begin, I have been stuck on this problem for about a 5 days, now. I have tried and just seem to be not getting anywhere. I know that the explanation is lengthy, but I am a...
3
by: Saxman | last post by:
=DCount("*","Clients"," = '1'")+DCount("*","Clients"," = '1'")+DCount("*","Clients"," = '1'")+DCount("*","Clients"," = '1'")+DCount("*","Clients"," = '1'")+DCount("*","Clients"," = '1'") The...
2
by: Kaspa | last post by:
Hello I am trying to create dcount field but is not working I have tried every way possible and I can't get it to work. here is my code: =Dcount("","qryTotalscratched"," in (6,7,8,9) and ...
1
by: Vikas | last post by:
Hi all, I am working on a document control database where I have a table "tblControl" containing two columns "DocID" and "SchIssueDate". "DocID" is the key field with text format while...
47
by: Jo | last post by:
Hi there, I'm Jo and it's the first time I've posted here. I'm in process of creating a database at work and have come a little unstuck.....I'm a bit of a novice and wondered if anyone could...
1
by: RussCRM | last post by:
I need some help getting unique records from our database! I work for a small non-profit homeless shelter. We keep track of guest information as well as what services we have offered for...
4
by: 6afraidbecause789 | last post by:
I was able to glean syntax online for a DCount on a form that counts the number of 'misbehavior' incidents for students for the current day: =DCount("StudentID","Incidents","StudentID=" & Forms!...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.