Prefill data ouput with a zero if blank

Swifey

Active Member
Joined
Jan 16, 2003
Messages
421
Could you please help I’m using three Tables in my query as follows:-

Table1 – Contains the Product Codes I want to analyse
Table2 – Contains the Product Sales for period 1
Table3 – Contains the Product Sales for period 2

1 I link Table1 by product to Table2 to include ALL records from Table1.
2 Then I link Table1 by product to Table3 to include ALL records from Table1.

My output is as follow

Products(Table1) Period 1(Table2) Period 2(Table3)
1234 1 1
4321 1
5746 1
9946
8940 1

As you can see I get BLANKS coming through. - Is there any way in the query, that I can fill all the blanks with a zero?

Kind Regards
Lynda
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Replace your 2 product sales fields in your query with expressions such as follows:

FixBlank1: IIf(IsNull([ProductSales1])=True,0,[ProductSales1])
FixBlank2: IIf(IsNull([ProductSales2])=True,0,[ProductSales2])

HTH,
 
Upvote 0
I wanted to add that it would be better to set the default value of these two fields to zero; no calculations.

Corticus
 
Upvote 0

Forum statistics

Threads
1,221,508
Messages
6,160,222
Members
451,631
Latest member
coffiajoseph

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top