Results 1 to 2 of 2
  1. #1
    mseeker22 is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jun 2011
    Posts
    35

    Simple code syntax question

    I'm trying to get this statement to return a 0 (Zero) if Null . . . for some reason I can't get it right.

    =DSum("[Discount Value]","Q_SCUsage")

    Something like

    IIF(IsNull(=DSum("[Discount Value]","Q_SCUsage")),"0",(=DSum("[Discount Value]","Q_SCUsage")))

    Getting my syntax muddled up I think . . . its the DSum thats throwing me a little!

    Thanks

  2. #2
    mseeker22 is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jun 2011
    Posts
    35
    Got it working . . . using Nz function -

    =Nz(DSum("[Discount Value]","Q_SCUsage"),0)

    Just in case anyone is looking in the future

Please reply to this thread with any new information or opinions.

Similar Threads

  1. ORDER BY ... If (SQL syntax question)
    By Remster in forum Forms
    Replies: 9
    Last Post: 05-18-2011, 06:54 AM
  2. Simple Syntax Help
    By cvegas in forum Programming
    Replies: 7
    Last Post: 04-20-2011, 01:46 PM
  3. simple VB code help
    By avworx in forum Programming
    Replies: 2
    Last Post: 03-29-2011, 07:09 PM
  4. Replies: 3
    Last Post: 10-15-2010, 11:17 AM
  5. simple syntax question
    By markjkubicki in forum Programming
    Replies: 6
    Last Post: 09-14-2010, 04:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums