Results 1 to 7 of 7
  1. #1
    Join Date
    Apr 2022
    Posts
    3

    Issue with Date comparison with dates between 1920 and 1901

    Update btab as b inner join btab_prior as b2 on (b.[billing number] = b2.[billing number]) and (b.ssn = b2.ssn)

    set b.[prior dom] = iif(b2.[prior dom] > cdate('01/01/1901'),b2.[prior dom],null), b.[prior contrib] = b2.[prior contrib]

    btab and btab_prior are both defined same way.
    Column [prior dom] is a date/time
    for btab values of [prior dom] of 4/29/1904 and 3/24/1903 specifically, the iif statement returns null. Works correctly for all


    other dates.

    Any help would be appreciated.

  2. #2
    Join Date
    Apr 2022
    Posts
    3

    Issues with dates between 1920 and 1900 is date comparisions

    Update btab as b inner join btab_prior as b2 on (b.[billing number] = b2.[billing number]) and (b.ssn = b2.ssn)

    set b.[prior dom] = iif(b2.[prior dom] > cdate('01/01/1901'),b2.[prior dom],null), b.[prior contrib] = b2.[prior contrib]

    btab and btab_prior are both defined same way.
    Column [prior dom] is a date/time
    for btab values of [prior dom] of 4/29/1904 and 3/24/1903 specifically, the iif statement returns null. Works correctly for all
    other dates.

    Any help would be appreciated.

  3. #3
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,988
    Why post the same question twice?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  4. #4
    Join Date
    Apr 2022
    Posts
    3
    Sorry, I'm new to the forum.

  5. #5
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,988
    I would upload your db for someone to look at.
    I'd certainly start with a simple select with the iif() function and see what results.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,952
    I cannot replicate issue.

    If you want to provide db for analysis, follow instructions at bottom of my post.
    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.

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,525
    Threads merged since both had replies.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 2
    Last Post: 07-17-2019, 05:37 PM
  2. Sum IIF date comparison issue
    By sergi117 in forum Access
    Replies: 3
    Last Post: 10-05-2018, 11:30 AM
  3. Replies: 8
    Last Post: 03-18-2016, 11:02 AM
  4. RC Notation and Date Comparison
    By mkc80 in forum Access
    Replies: 2
    Last Post: 10-10-2012, 06:22 PM
  5. Replies: 0
    Last Post: 07-27-2009, 07:51 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