문제

SELECT Name,
SUM(Switch([Date] = DateAdd('d', - 7, DATE ()), NetAmount) )AS DAY1 
FROM Customer GROUP BY Name

The above query works fine but my question is I want to return the value 0 for the empty field in the MS Access database. if the date is not present in the database means. .

either use switch or iif please help me . .

도움이 되었습니까?

해결책

The function NZ(value, value_if_null) should do the trick.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top