|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now! |
|
#1
|
|||
|
|||
|
Dcount Criteria Problem
I am using MS Access and I use the following SQL statement and it works properly:
intX = DCount("[cust code]", "qryFindWhatDone", "[comments] like '*' &6/11/2004 &'*' ") However, If I use intX = DCount("[cust Code]", "qryFindWhatDone", "[comments] like '*' & DateToCheck & '*' "), I am get the following error: The expression you entered as a query parameter produced this error: 'The object doesn't contain the Automation object 'DateToCheck." I want to get total for the amount of records that has a particular date as a part of the information that is stored in the COMMENT field. If I type in the date, it works. However, I want to store the date in a variable and include the variable as a part of the criteria. This is because the date will be stored from a text box on a form. Can you pleeeeaaassee help me? Thanks much. Taffy. |
|
#2
|
|||
|
|||
|
more info
Is the variable DateToCheck something that you are taking from an input form? Otherwise, how is it being derived??
|
|
#3
|
|||
|
|||
|
Guys -
I went through and found a way to get around this. Not pretty, but it works. I create a query, link it to a textbox on the form and use a variable to keep changing the date in the text box. I put this in a loop and woops! it works like a charm! Thanks much, though. Taffy |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > Dcount Criteria Problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|