470,822 Members | 1,356 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,822 developers. It's quick & easy.

DCount - error finding - Date Criteria

2 2Bits
Hi,
I need help, sorry my english.

Ive this a date (01/01/2021) and its a holiday(TbHolidays) and i want to count if is or not to continue the function.
i ve this.
DateGO is 01/01/2021 and should find in Datehol Field in table TbHolidays the same date(is in shortdate too). but gives 0 and not 1.

Check = Nz(DCount("*", "tbHolidays", "[DateHol] = #" & DateGo & "#"), 0)
Attached Files
File Type: zip NextWorkday test.zip (124.8 KB, 30 views)
Jan 25 '21 #1

✓ answered by cactusdata

You can use:

Expand|Select|Wrap|Line Numbers
  1. Check = DCount("*", "tbHolidays", "[DateHol] =  #" & Format(DateGo, "yyyy\/mm\/dd") & "#")

2 1501
cactusdata
200 Expert 128KB
You can use:

Expand|Select|Wrap|Line Numbers
  1. Check = DCount("*", "tbHolidays", "[DateHol] =  #" & Format(DateGo, "yyyy\/mm\/dd") & "#")
Jan 26 '21 #2
joaofigu
2 2Bits
Thanks a lot!! it does the thing!!!
I
Jan 26 '21 #3

Post your reply

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

Similar topics

11 posts views Thread by David B | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.