"If - Then" Return These Records

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a query based off of two tables. There are date fields in each of the
tables (class date and enroll date). The query includes each of the date
fields. I tried to do a criteria that would only display those records where
the enroll date was greater than the class date. I couldn't get anything to
return even though some dates in the enroll date fields were greater than
those in the class dates. Is there something I need to do because they are
time/date fields? Could I build an expression in another field in the query
that said "IF enroll date > class date THEN display the text "need to enroll"?
 
BM said:
I have a query based off of two tables. There are date fields in
each of the tables (class date and enroll date). The query includes
each of the date fields. I tried to do a criteria that would only
display those records where the enroll date was greater than the
class date. I couldn't get anything to return even though some dates
in the enroll date fields were greater than those in the class dates.
Is there something I need to do because they are time/date fields?
Could I build an expression in another field in the query that said
"IF enroll date > class date THEN display the text "need to enroll"?

Post your query. A basic greater than or less than should work fine here...

SELECT *
FROM TableName
WHERE [class date] < [enroll date]

These ARE actual DateTime fields right? Not text fields containing strings that
look like dates?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top