467,877 Members | 1,294 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

DCount - error finding - Date Criteria

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, 11 views)
4 Weeks Ago #1

✓ answered by cactusdata

You can use:

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

  • viewed: 1184
Share:
2 Replies
cactusdata
Expert 128KB
You can use:

Expand|Select|Wrap|Line Numbers
  1. Check = DCount("*", "tbHolidays", "[DateHol] =  #" & Format(DateGo, "yyyy\/mm\/dd") & "#")
4 Weeks Ago #2
2Bits
Thanks a lot!! it does the thing!!!
I
4 Weeks Ago #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 jack112 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.