Dcount (1 Viewer)

mester

Member
Local time
Today, 08:41
Joined
Apr 2, 2020
Messages
63
Hi everyone, if you please i wanna count how many lignes between two dates, i mean date from A to B. So i used dcount, but i didn't know what to use in the criteria.
Me.textbox1=Dcount("[expr1]","table1","[criteria1]= between #"& me!textbox5 &"# and #"& me!textbox6 &"# ")
Is this one correct please????
 

Isaac

Lifelong Learner
Local time
Today, 00:41
Joined
Mar 14, 2017
Messages
8,778
Me.textbox1=Dcount("*","table1","between #" & format(me.textbox5,"mm/dd/yyyy") & "# and #" & format(me.textbox6,"mm/dd/yyyy") & "# ")

Does that work?
 

mester

Member
Local time
Today, 08:41
Joined
Apr 2, 2020
Messages
63
Me.textbox1=Dcount("*","table1","between #" & format(me.textbox5,"mm/dd/yyyy") & "# and #" & format(me.textbox6,"mm/dd/yyyy") & "# ")

Does that work?
Hi , i am working on it to see if it will work
 

mester

Member
Local time
Today, 08:41
Joined
Apr 2, 2020
Messages
63
Me.textbox1=Dcount("*","table1","between #" & format(me.textbox5,"mm/dd/yyyy") & "# and #" & format(me.textbox6,"mm/dd/yyyy") & "# ")

Does that work?
Sorry Sir, it doesn't work for me.
 

Isaac

Lifelong Learner
Local time
Today, 00:41
Joined
Mar 14, 2017
Messages
8,778
Can you post (Copy and Paste into your response here) the expression you're using in the Textbox?
Or the code, if it's VBA ?
 

Isaac

Lifelong Learner
Local time
Today, 00:41
Joined
Mar 14, 2017
Messages
8,778
Sorry, typo:
Try:
Code:
Me.textbox1=Dcount("*","table1","[DateFieldName] between #" & format(me.textbox5,"mm/dd/yyyy") & "# and #" & format(me.textbox6,"mm/dd/yyyy") & "# ")
 

mester

Member
Local time
Today, 08:41
Joined
Apr 2, 2020
Messages
63
Here is the code i used, thanks for your help
 

Attachments

  • IMG_20200909_232654.jpg
    IMG_20200909_232654.jpg
    459 KB · Views: 88

Isaac

Lifelong Learner
Local time
Today, 00:41
Joined
Mar 14, 2017
Messages
8,778
I corrected typo, see prev. post, thx
 

Users who are viewing this thread

Top Bottom