Count only rows in specific field with date (1 Viewer)

Trilback

Registered User.
Local time
Today, 15:32
Joined
Nov 29, 2013
Messages
88
I have an access forum that I need to have a textbox count how many rows have dates in my "Ship_To_Date_HP_" field
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 12:32
Joined
Aug 30, 2003
Messages
36,142
Try a textbox in the form footer:

=Sum(IIf(IsDate(FieldName), 1, 0))
 

Trilback

Registered User.
Local time
Today, 15:32
Joined
Nov 29, 2013
Messages
88
Try a textbox in the form footer:

=Sum(IIf(IsDate(FieldName), 1, 0))

I have one in the forum header but its not reading right as I can count 5 from the data I have and it says 0 right now.

Code:
=Sum(IIf(IsDate([Receive_From_Date(HP)]),1,0))
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 12:32
Joined
Aug 30, 2003
Messages
36,142
Worked for me in a test. Are you sure that's a date/time field?
 

Trilback

Registered User.
Local time
Today, 15:32
Joined
Nov 29, 2013
Messages
88
Say I have another field that I wanted to sum up that has numbers only would I still do the same thing but without the isdate function?
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 12:32
Joined
Aug 30, 2003
Messages
36,142
Depends on your specifics. You can test for >0, use IsNumeric() or IsNull(), etc.
 

Users who are viewing this thread

Top Bottom