473,287 Members | 1,714 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

DCount - error finding - Date Criteria

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

I´ve this a date (01/01/2021) and it´s 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, 60 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 1950
cactusdata
214 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

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

Similar topics

11
by: David B | last post by:
I have 2 querys with the following in the date criteria Between DateAdd("m",-6,(!!)) And (!!) Between DateAdd("m",-24,(!!)) And DateAdd("m",-6,(!!)) Problem is they both look at the same...
1
by: TriednTested | last post by:
Hello I have a subform and to edit the data I place it on the main form where changes can be made, then a cmd button is used to execute the docmd.runsql update query. However I am constantly getting...
0
by: zeusspandex | last post by:
Im creating a cross tab query which sorts via and sums the for each type of . I want to be able to add a date criteria, so the user can specify that the query processes data between two dates. ...
1
by: zeusspandex | last post by:
Hi, i have the following SQL query and would like to add date criteria to it. the field being from the table and the criteria being Between !! And !! query: SELECT , ...
3
by: shawnmiller77 | last post by:
Need Help ASAP! History: Installed new SBS 2003 server on Monday. Migrated IIS, website and current Access database over to new server. I did not develop the website or Access database. Former...
5
by: sh55555 | last post by:
I have built a query in Access using the DateSerial function to convert dates such as 20100401 to 04/01/2010. The query results work fine and the date is displayed correctly. I am now trying to...
9
by: Raza Zahur | last post by:
Hi all, I've googled and googled but I can google no more, so I am here to ask for help on an issue I am having. I have a macro that runs a series of queries. Before the macro can be run, the...
4
by: Neruda | last post by:
Hi, have a crosstab query that works ok so far Need a dynamic date criteria. I use a tempVar from a Form. If I write in vba TempVars!SelectedReportDate = "05/06/2020" this is ok ...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.