Results 1 to 4 of 4
  1. #1
    Compufreak is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jul 2012
    Posts
    70

    SSRS : Get min and max dates by default if the field is null

    Hi all

    please can you guys assist me...

    I am trying to get the min and max dates should the start date and end date fields be null.

    can anyone assist me with this ....

    I did it before in access , I am now trying it in SSRS and well its killing me .

    Thanks again guys

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    What is SSRS and why do you post a question about it in an Access forum?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Dal Jeanis is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    Not sure what you mean by Min and Max Dates. If you mean the Minimum and Maximum dates that happen in the data, you can just use a far past and far future date in an IIF or NZ statement and let the data worry about itself.
    Code:
    WHERE TheDate >= NZ(MyStartDate,#01/01/1900#) 
    AND  TheDate <= NZ(MyEndDate,#12/31/2199#)

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Nz might not work in SSRS (whatever that is). I think it is an Access function. I have known it to fail in Excel VBA code. I tried to have Excel link to Access query that used Nz and it bombed. Had to change the query. If Nz fails try the IIf:


    WHERE TheDate BETWEEN IIf(IsNull([MyStartDate]),#01/01/1900#,[MyStartDate]) AND IIf(IsNull([MyEndDate]),#12/31/2199#,[MyEndDate])
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 7
    Last Post: 08-12-2013, 08:28 AM
  2. Replies: 8
    Last Post: 06-13-2012, 08:08 PM
  3. Replies: 2
    Last Post: 08-01-2011, 09:30 AM
  4. Replies: 6
    Last Post: 07-20-2011, 11:54 AM
  5. How to run a SSRS report from Access
    By gspafford in forum Reports
    Replies: 0
    Last Post: 11-04-2009, 10:03 AM

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