Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

division by zero 1

Status
Not open for further replies.

ttuser4

MIS
Joined
Jun 19, 2008
Messages
147
Location
CA
i want to calculate rectangle circuit (ALU) and rectangle area (ALU) of two (D=0 and C=0) or three (D=0) or four rectangles (twice)

Y is one side and A/B/C/D is other side (if C/D exists)

SELECT BMsr.Type, BMsr.Y, BMsr.Span, BMsr.A, BMsr.B, BMsr.C, BMsr.D, 4*(A+B+C+D+A/A*Y*2+B/B*Y*2+C/C*Y*2+D/D*Y*2) AS ALU, 2*(Y*A+Y*B+Y*C+Y*D) AS GLA
FROM BMsr;

but the problem is error if C or D is zero. is there better way to do it?
 




Use IIF
[tt]
IIF(C=0,0,C)
[/tt]
in
[tt]
2+C/IIF(C=0,0,C)
[/tt]


Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 


oops

[tt]
2+C/IIF(C=0,1,C)
[/tt]
of instance


Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top