Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    Jul 2001
    Location
    Washington, District Of Columbia, USA
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Access 2010: Date String to Date for Query by Form

    I have the following fields in a query

    Date Cleared (a date field)
    Cleared for (select - 1 year; 2 years; not cleared)

    I have an expression Cleared Until: IIf([Cleared for How Long?]="1 Year",DateAdd("yyyy",1,[date client approved story]),DateAdd("yyyy",2,[Date Client Approved Story])).

    It works, but comes back as a string. I want to use a form to query on it as a date (e.g., bring back records that are cleared at least until 12/31/2014). I've tried adding DateValue, CDate and CVDate, but none seem to bring back a date for me to query against (e.g., >=[Forms]![SelectionForm]![txtClearedUntil]). Suggestions, please.

    Cleared Until Exp: DateValue(IIf([Cleared for How Long?]="1 Year",DateAdd("yyyy",1,[date client approved story]),DateAdd("yyyy",2,[Date Client Approved Story])))

    Thank you!
    Alysha
    Last edited by aetaylor; 2014-10-03 at 18:01. Reason: Improve clarity?

  2. #2
    New Lounger
    Join Date
    Jul 2001
    Location
    Washington, District Of Columbia, USA
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This may have just been a case of grumpy access database. I closed and re-opened and now it seems to be working.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •