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 Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Where string takes forever when using dates only

Status
Not open for further replies.

TonyG

Programmer
Nov 6, 2000
79
US
Hello.

When i use the following string in a "DoCmd.OpenReport stDocName, acViewPreview, , strWhere", it gives me the report i want:
"[COMPANY NAME] = 'A V H INTERIORS 4061' AND TempStatus.JOBNO In (SELECT JOBNO FROM TempStatus WHERE WORKSTATION= '#2- RECEIVED' AND [TempStatus].TIMESTAMP Between #01/01/2004# And #1/01/2054#)"

Yet if i use this string, it takes forever to get a report. Can somebody explain why ?

" TempStatus.JOBNO In (SELECT JOBNO FROM TempStatus WHERE WORKSTATION= '#2- RECEIVED' AND [TempStatus].TIMESTAMP Between #01/01/2004# And #01/01/2054#)"

Here is the query that is the Record Source for the report.

SELECT DISTINCT TempStatus.WORKSTATION, TempStatus.TIMESTAMP,
TempStatus.JOBNO, [PENDING ORDERS].DESCRIPTION, [PENDING ORDERS].TARGET, [PENDING ORDERS].[COMPANY NAME], [PENDING ORDERS].SIDEMARK, [PENDING ORDERS].TIMESTAMP, [PENDING ORDERS].[NUMBER OF FABRICS], INSTALL.INSTALLER,
INSTALL.[INSTALL DATE], INSTALL.[INSTALL NOTES], INSTALL.WORKSTATION, INSTALL.TIMESTAMP
FROM ([PENDING ORDERS] LEFT JOIN TempStatus ON [PENDING
ORDERS].JOBNO=TempStatus.JOBNO) LEFT JOIN INSTALL ON [PENDING ORDERS].JOBNO=INSTALL.[JOB NO]
ORDER BY TempStatus.TIMESTAMP;

Any help would be greatly appreciated.

Thanks,
Tony
 
please do NOT post the same question in multiple fora. This primarily demonstrates your lack of undestanding of the issue and politness. Many of the potential respondents dislike having to check the several instances of yoiu inquiry to see if someone else has previously responded in one of the other fura.





MichaelRed


 
Hello MichaelRed.

I'm sorry for that. I'm used to other forum areas on the internet that allow posting a question to multiple forums.

These forums provide a great way to learn and understand specific products and i appreciate everybody that contributes. I have used these forums many times and got a lot of answers that were very helpful.

Thanks for that information.

Tony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top