Hi
I'm building a report that uses a specific table [tblDataRecords] and I'm using textboxes to present specific results that have stripped out certain other results.
In order to achieve the desired output, I've created the following DCount but need to combine a textbox property name and a wildcard.
The textbox contains a formatted date in this format: yyyymmdd
Here are my Control Source DCounts that do not work :
Code:=DCount("[RCODE]","tblDataRecords","[RCODE] = '99' AND [NAME] ='George Lucas' AND [REFERENCE] LIKE [RefDate]'*'")Code:=DCount("[RCODE]","tblDataRecords","[RCODE] = '99' AND [NAME] ='George Lucas' AND [REFERENCE] LIKE [RefDate]&'*'")
To elaborate, my [REFERENCE] column in my table is made up of mixed data and I want to find only the records that start with a date, as formatted above, while also filtering for the other criteria in the DCount.
I have managed to get the following source to work :
Code:=DCount("[RCODE]","tblDataRecords","[RCODE] = '99' AND [NAME] ='George Lucas' AND [REFERENCE] LIKE'202*'")
... where "202" represents the beginning of 2021... but I am using a referenced date in the textbox [RefDate] as this is dynamic and changes based on =Now()-x ...
So, as the date will have changed each time the Access file is opened, the following is my query:
- I need to combine the property name [RefDate] and a wildcard of '*' in order to search for fields in the [REFERENCE] that match yyyymmdd and the next 10 unknown numeric characters.
- for example
- 202103161234567890
The finished control source calculation will be placed in another text box.
Thanks in advance for any guidance.