UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Dcount From Query Based On Form Date, Access 2016    
 
   
lite4d
post Jun 3 2020, 08:24 AM
Post#1



Posts: 23
Joined: 5-August 14



I have a report that is called from dates on a form([Start Date] and [End Date]). I need to due a running sum from a query that is filtered by those dates. I'd like it to count the records from that query that are "=<" the end date chosen on the form. Here is what I have:


=DCount("[Storage Type]","7R NSN's inventoried by month","[storage type]"<=#" & [forms]![Inventory stats]![End Date])

I get a date issue.
This post has been edited by lite4d: Jun 3 2020, 08:27 AM
Go to the top of the page
 
MadPiet
post Jun 3 2020, 08:50 AM
Post#2



Posts: 3,784
Joined: 27-February 09



You're missing a closing # around your date.

=DCount("[Storage Type]","7R NSN's inventoried by month","[storage type]"<=#" & [forms]![Inventory stats]![End Date] & "#")

(Note the closing #)
Go to the top of the page
 
lite4d
post Jun 3 2020, 08:55 AM
Post#3



Posts: 23
Joined: 5-August 14



Thanks for the reply but I'm still getting the "the expression you entered has an invalid date value"
Go to the top of the page
 
GroverParkGeorge
post Jun 3 2020, 09:37 AM
Post#4


UA Admin
Posts: 37,480
Joined: 20-June 02
From: Newcastle, WA


Hm. It looks like you are trying to compare [storage type] to a value in a control on a form that is apparently supposed to be a date. So is [storage type] also a date?

--------------------
My Real Name Is George. Grover Park Consulting is where I did business for 20 years.
How to Ask a Good Question
Beginning SQL Server
Go to the top of the page
 
GroverParkGeorge
post Jun 3 2020, 09:39 AM
Post#5


UA Admin
Posts: 37,480
Joined: 20-June 02
From: Newcastle, WA


And I REALLY think you need to give your naming convention a second look. Names like "7R NSN's inventoried by month" tend not to be very appropriate, especially because it includes an apostrophe in it. While Access is very forgiving, and will tolerate a lot of non-standard approaches, it's usually safer to stick to the basics.

--------------------
My Real Name Is George. Grover Park Consulting is where I did business for 20 years.
How to Ask a Good Question
Beginning SQL Server
Go to the top of the page
 
lite4d
post Jun 3 2020, 11:01 AM
Post#6



Posts: 23
Joined: 5-August 14



Storage type is a number not a date. I just used that field to count.
This post has been edited by lite4d: Jun 3 2020, 11:02 AM
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    8th July 2020 - 03:06 AM