Results 1 to 5 of 5
  1. #1
    Bike is offline Novice
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    14

    Expired Date Query Design

    I have two fields in my query.



    Serial Number [Number]
    Warranty Expiry Date [Med Date]


    Is it possible to create a query that if the date in the Warranty Expiry Date field is older than the current today's date, it will check a expired option in a yes / no or another field.

  2. #2
    ketbdnetbp is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Midwest
    Posts
    254
    Bike -

    Try pasting something like this into a blank column in the query designer, then run the query.

    Expired: IIF(IsDate([Warranty Expiry Date])=False,”Warranty Date Invalid or Missing”,IIF([Warranty Expiry Date]>Now(),”No”,”Yes”))

    Hope this helps…

  3. #3
    Bike is offline Novice
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    14
    Doesn't seem to be working, giving me invalid syntax. I appreciate the help though!

  4. #4
    ketbdnetbp is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Midwest
    Posts
    254

    Bike

    Try this instead -

    Expired: IIf(IsDate([Warranty Expiry Date])=False,"Warranty Invalid",IIf([Warranty Expiry Date]>Date(),"No","Yes"))

    I tested it in A2010 and it works just fine. It was just a matter of replacing "Now()" with "Date ()"

    All the best

  5. #5
    Bike is offline Novice
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    14
    Quote Originally Posted by ketbdnetbp View Post
    Try this instead -

    Expired: IIf(IsDate([Warranty Expiry Date])=False,"Warranty Invalid",IIf([Warranty Expiry Date]>Date(),"No","Yes"))

    I tested it in A2010 and it works just fine. It was just a matter of replacing "Now()" with "Date ()"

    All the best
    Works perfect, thanks a lot! Appreciate it.

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

Similar Threads

  1. Table design or query or?
    By Laaacux in forum Database Design
    Replies: 5
    Last Post: 02-22-2011, 02:13 PM
  2. Using a Design View Query in ADO?
    By danny2000 in forum Access
    Replies: 4
    Last Post: 12-06-2010, 03:36 AM
  3. query syntax or design help ....
    By cowboy in forum Queries
    Replies: 1
    Last Post: 02-04-2010, 11:24 AM
  4. Replies: 2
    Last Post: 07-31-2009, 06:56 AM
  5. Timeout Expired
    By brvaland in forum Database Design
    Replies: 0
    Last Post: 04-03-2009, 04:12 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