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

Easy one

Status
Not open for further replies.

ProtegeV2

Technical User
Sep 9, 2004
40
CA
Hi! I am creating a report based on a query - here is the SQL so far: Note: [Docket #] = [PRNumber] (same number)

SELECT [Project Expenses Table].[Docket #], [Project Expenses Table].[Invoice ID], [Project Expenses Table].[Invoice Date], [Project Expenses Table].[Invoice Amount], [Project Expenses Table].[Description of Invoice], tblPPOScript.MemoTo, tblPPOScript.FromNames, tblPPOScript.AirDate, tblPPOScript.OutageDatePlace, tblPPOScript.OutageNecessary, tblPPOScript.PRNumber
FROM [Project Expenses Table] INNER JOIN tblPPOScript ON [Project Expenses Table].[Docket #] = tblPPOScript.PRNumber
WHERE ((([Project Expenses Table].[Invoice ID])>"0"));

I think the easiest way to explain my problem is to give you an example. Docket #3298 has two invoices entered so far in the Project Expenses Table. A separate table, tblPPOScript.PRNumber, has eight matching dockets - the remaining six PRNumbers have not been invoiced yet. How do I select only the two invoiced dockets, but include the corresponding information in the SQL from tblPPOScript? I tried inner join but it still gives me all records. I hope that makes sense. Thanks in advance.
 
This WHERE clause:

Code:
((([Project Expenses Table].[Invoice ID])>"0"));

will return all records where the string in [Invoice ID] is not '0'. Is [Invoice ID] a string or a number? if it's a string, then you probably need to replace the where clause with:

Code:
((([Project Expenses Table].[Invoice ID])>""));

If it's a number, then you need to get rid of the "" around the 0.




Leslie
 
Thanks for your reply Leslie. I found out my problem was with my report sorting and grouping and not the query afterall.

Have a star for your time!
 
well good, cause I couldn't see anything wrong in the query and was taking a stab in the dark!!!

Glad you got it worked out!

thanks for the star!

les
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top