3
317342
Hi everyone,
After seaching for a few days, I still can't understand how to
implement nulls / zero length.
I have a table called sales recording all sales records. Now I want to
run some queries:
1: select stuffs sold in the last 7 days. List their ID, blah blah, and
price of each item sold at. The field is called "price"
2: sum the price of all items using query #1 (above)
Problems: If nothing had been sold in the last 7 days ......
1: will return nothing. I want it to return $0
2: sum will return nothing. Of course I want it to return $0 as well.
I know there are NZ & IIF functions. With query 1, I've tried Expr1:
Nz([price],0). It still returns me blank field. In order to figure what
Access is returning me, I tried Expr1: IIf([price] Is
Null,"stupied",[price]), which returns me blank fields. I then tried
Expr1: IIf([price]="","stupied",[price]), and it is still giving me
blank fields.
What else can I try? Am I going the wrong direction?
After seaching for a few days, I still can't understand how to
implement nulls / zero length.
I have a table called sales recording all sales records. Now I want to
run some queries:
1: select stuffs sold in the last 7 days. List their ID, blah blah, and
price of each item sold at. The field is called "price"
2: sum the price of all items using query #1 (above)
Problems: If nothing had been sold in the last 7 days ......
1: will return nothing. I want it to return $0
2: sum will return nothing. Of course I want it to return $0 as well.
I know there are NZ & IIF functions. With query 1, I've tried Expr1:
Nz([price],0). It still returns me blank field. In order to figure what
Access is returning me, I tried Expr1: IIf([price] Is
Null,"stupied",[price]), which returns me blank fields. I then tried
Expr1: IIf([price]="","stupied",[price]), and it is still giving me
blank fields.
What else can I try? Am I going the wrong direction?