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

Adding integers to NULL values ? 1

Status
Not open for further replies.

Webkins

Programmer
Dec 11, 2008
118
US
I am using Access 2003. I have this following VBA expression:

overtime = monday + tuesday + wednesday + thursday + friday + saturday + sunday

For example, if monday = 9 and any of the other days are null then overtime = null. How can I add this string and result with an answer of 9 ?

Thanks so much...
 
Webkins,
I hope this doesn't resemble your table structure. Typically a normalized table structure requires summing across records and not fields.

Regardless:
Code:
overtime = Nz(monday,0) + Nz(tuesday,0) + Nz(wednesday,0) + Nz(thursday,0) + Nz(friday,0) + Nz(saturday,0) + Nz(sunday,0)

Duane
Hook'D on Access
MS Access MVP
 
what are your qualifiers for OT? Can you provide the criteria for OT? anything over 8?, over 40? calculated daily? weekly?

HTH << MaZeWorX >> "I have not failed I have only found ten thousand ways that don't work" <<Edison>>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top