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

[Updated below] I am having a problem connecting to a MySQL database using a
hi I'm having problem with my database. I'm using access as my database and
I'm having problem in my datagridview. I'm using vb 2008 and an access database.
I have the following problem in a Database using Access 2007 as front end
i have little problem in using my application application having msaccess database if i
I'm having an issue with writing back to my Access Database (.accdb) through using
Using Access Database Table ID Time 001 100000 001 100005 001 103000 001 102500
Using Access 2003 Database Table1 Intime Outtime WorkTime OverTime 08:00:00 19:00:00 09:00:00 02:00:00 09:00:00
USING MS ACCESS 2003 How to check is null value in the access database?
I am using Microsoft Access database for storing data. In that, I stored date

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.