472,967 Members | 1,922 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,967 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, 56 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 1908
cactusdata
210 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 ...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.