Null Values in query

alsoszaa

New member
Local time
Yesterday, 16:45
Joined
Dec 2, 2005
Messages
8
I need to create a query with the MTD field
I have created the MTD and it works!!! but now I need it to show all of the PartNum fields even if null. do I need to convert all nulls to zeros? if so how do I go about this?

Here are the fields in the query

First Field:
Field: PartNum
Table: Part
Total: Group By

Second Field:
Field: UnitPrice
Table: OrderDetail
Total: Group By

Third Field:
Field: NumOrdered
Table: OrderDetail
Total: Sum

Fourth Field:
Field: MTD: Sum([NumOrdered]*[UnitPrice])
Table: (blank)
Total: Expression

Fifth Field:
Field: CurrentYear: Year([OrderDate])
Table: (blank)
Total: Group By
Criteria: Year(Date())

Sixth Field:
Field: CurrentMonth: Month([OrderDate])
Table: (blank)
Total: Group By
Criteria: Month(Date())

When I run the query I only get 2 parts and their total. but I want all parts to show up even if they have not been ordered in the month. the parts that have not been ordered should say $0.00 in the MTD field.

Any Suggestions???
 
You need to adjust the table joins in the query. With the query in design view, you should be able to look at the tables with the lines between them. These lines indicate the relationships. Click on the line and select "Join Properties". This will give you the option to include all the records from one or the other tables.

hth,

- g
 
I understand relationships and joining tables in my query, however this is not the problem.
 

Users who are viewing this thread

Back
Top Bottom