Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6686917
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:13:39+00:00 2026-05-26T05:13:39+00:00

im using Access as the database and im having a problem with the query

  • 0

im using Access as the database and im having a problem with the query below. I know the problem is with the email_date field but I dont know how to fix it. The problem is a text field which im trying to make use it as a datefield by using CDATE and compare it to a actual datefield which is causing the problem. Im getting the data mismatch error. In the email_date field if there is nothing, the field consists of ‘–‘, else it has 9/21/2011. Any help would be very much appreciated.

 SELECT A.ICAO, A.IATA, A.AIRPORT_NAME, A.CITY, A.COUNTRY, 
 A.REVISED_DATE, A.COMPANY, A.EMAIL_DATE 
 FROM AIRPORT_CHECKLIST A  
 WHERE A.COMPANY = 'company' 
 AND FLAG_DELETE = 'No' 
 AND EMAIL_DATE <> '--'
 AND CDATE(REVISED_DATE) > CDATE(EMAIL_DATE)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T05:13:39+00:00Added an answer on May 26, 2026 at 5:13 am

    You can add a nested IIf() expression in the WHERE clause: return False if EMAIL_DATE is “–“; otherwise return True or False depending up the CDate() comparison of the two fields. A row will only be included in the result set if that expression returns True.

    SELECT
        A.ICAO,
        A.IATA,
        A.AIRPORT_NAME,
        A.CITY,
        A.REVISED_DATE,
        A.COMPANY,
        A.EMAIL_DATE
    FROM
        AIRPORT_CHECKLIST AS A
    WHERE
            A.COMPANY='company'
        AND IIf(EMAIL_DATE='--',False,
                IIf(CDATE(REVISED_DATE) > CDATE(EMAIL_DATE),True,False))
        AND A.FLAG_DELETE='No';
    

    Also if both “date” fields were text type, you could store the date values in “yyyy-mm-dd” format and simply compare the text values with no data type mismatch problems.

    A.EMAIL_DATE <> '--' AND A.REVISED_DATE > A.EMAIL_DATE
    

    Edit: If FLAG_DELETE is Yes/No type (instead of text type), use a literal False in the comparison.

    AND A.FLAG_DELETE=False
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having problem in my datagridview. I'm using vb 2008 and an access database.
hi I'm having problem with my database. I'm using access as my database and
Using DTS I'm dynamically creating an access database. After the file is created (which
I have a ASP.Net page using ADO to query MS access database and as
I'm having an issue with writing back to my Access Database (.accdb) through using
I'm currently developing a PHP application that's using an Access database as a backend.
Our app (already deployed) is using an Access/Jet database. The upcoming version of our
I am trying to do an automated xml export from an access database using
I am using following PHP code to connect to MS Access database: $odb_conn =
I have an access database with 3 tables. People Gifts PeopleGifts Using VS 2008,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.