Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

data parameter inaccurate results

Status
Not open for further replies.

cvaccess

Technical User
Jun 26, 2002
55
US
I have this query that is pulling incorrect data. For example, My Start Date is 06/24/02 and my End Date is 06/24/02. When I run this, it pulls 06/25/02 also.

Is this query wrong?

SELECT DISTINCTROW INDIV_TP_SUB.CHILD_TP AS TP, INDIV_TP_SUB.SCRUB_DATE AS [Scrub Date], Count(pend_list.CLAIM_NO) AS [Pended Total], [Enter Start Date:] & " - " & [Enter End Date:] AS [Given Time Period]
FROM pend_list INNER JOIN INDIV_TP_SUB ON (pend_list.TP = INDIV_TP_SUB.CHILD_TP) AND (pend_list.SCRUB_DATE = INDIV_TP_SUB.SCRUB_DATE)
WHERE (((pend_list.SCRUB_DATE) Between [Enter Start Date:] And [Enter End Date:]) AND ((pend_list.TP)=[INDIV_TP_SUB].[CHILD_TP]) AND ((pend_list.ERROR_1) In (502,791)) OR (pend_list.ERROR_2) In (502,791)) OR (pend_list.ERROR_3) In (502,791)
GROUP BY INDIV_TP_SUB.CHILD_TP, INDIV_TP_SUB.SCRUB_DATE
ORDER BY INDIV_TP_SUB.CHILD_TP DESC;

Thanks for the help.
 
Place all this in a string named SQL and look at SQL with MsgBox SQL.

You will see that your query is not what you think it is. You have to evaluate your dates at runtimie not at compile time.

rollie@bwsys.net
 
I am evaluating this at runtime. What is msgbox sql? Can anyone help me resolve this issue?

Thank you.
 
What you are sending the query is [Enter...Date] and what you should be sending is #1/2/2002# or some such similar.
(;--00)
 
If that is the case, why does another very similar query pull the right days?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top