Re: Default value return
- From: Dragon <Dragon@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 22 Jan 2009 14:30:00 -0800
When there are no records it simply doesn't display anything for that option.
I'm not familiar with the Nz() command recommended.
How would it fit into my query?
Thanks,
Dragon
"pietlinden@xxxxxxxxxxx" wrote:
On Jan 20, 4:09 pm, Dragon <Dra...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:.
I have a query that counts my trailers loaded in a given day for a given
warehouse. I have the data broken down by types (ie, export, truck, can) and
in a particular order.
The problem is: I need the query to return a default value of 0 for each
possiblity when there is no trailers of a particular type loaded in the given
day. (SQL below)
ie: if there were 3 non export, no export trucks and 2 export cans I need an
output of:
Non export: 3
Export Trucks: 0
Export Cans: 2
Thanks,
Dragon
SQL:
SELECT [PCS / Bulk Ship].Warehouse, [PCS / Bulk Ship].ShipDate, [PCS / Bulk
Ship].Export, [PCS / Bulk Ship].Can, Count([PCS / Bulk Ship].[Unit #]) AS
[CountOfUnit #]
FROM [PCS / Bulk Ship]
WHERE ((([PCS / Bulk Ship].[Unit #])>"0.1") AND (([PCS / Bulk Ship].Rail)=0))
GROUP BY [PCS / Bulk Ship].Warehouse, [PCS / Bulk Ship].ShipDate, [PCS /
Bulk Ship].Export, [PCS / Bulk Ship].Can
HAVING ((([PCS / Bulk Ship].Warehouse)='Bulk') AND (([PCS / Bulk
Ship].ShipDate)=[What is the date]))
ORDER BY [PCS / Bulk Ship].Export DESC , [PCS / Bulk Ship].Can DESC;
are you getting nulls? Use Nz() to convert the nulls to zeroes.
- Follow-Ups:
- Re: Default value return
- From: John Spencer (MVP)
- Re: Default value return
- References:
- Default value return
- From: Dragon
- Re: Default value return
- From: pietlinden@xxxxxxxxxxx
- Default value return
- Prev by Date: Re: Add times
- Next by Date: Re: Max or Large function
- Previous by thread: Re: Default value return
- Next by thread: Re: Default value return
- Index(es):
Relevant Pages
|