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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Nz Function To Return a Zero

Status
Not open for further replies.

jaaret

Instructor
Jun 19, 2002
171
Is there a way for the Nz function return an integer rather than a string?

=Nz(EndTime-BeginTime,0)

The above expression returns a zero as a string (aligned left) rather an an integer.
 
Not on my PC it doesn't! I thought NZ returned a variant, so you can return whatever value/type you want.

You could try explicitly casting to an integer:

=CInt(Nz(EndTime-BeginTime,0))

Ed Metcalfe.

Please do not feed the trolls.....
 
Perfect! Thanks! Much easier than the Iif function.

Cheers!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top