How do you say greater than and not equal to?

  • Thread starter Shelly Kendrick
  • Start date
S

Shelly Kendrick

I want all the records in the DateRptSubmitted field where the date is later
than the date in the DateEntered field. It's a quality control query to
catch bad dates in the DateRptSubmitted field. Both fields live in the same
table. I don't want to include records where the DateRptSubmitted is the
same date as the DateEntered, because there's nothing wrong with that. How
do you write the criteria for this?
 
L

Lance

There is no special syntax for that, because something can never be both
greater than and equal to something else. All you need is greater than...
 
S

Shelly Kendrick

But just > is not working. It's also giving me equal to and I don't want
equal to. I suppose I could make a table of the > result and then run a <>=
query against that table. I'll do that. It just seems like there ought to
be a way to do it with one query.
 
J

John W. Vinson

I want all the records in the DateRptSubmitted field where the date is later
than the date in the DateEntered field. It's a quality control query to
catch bad dates in the DateRptSubmitted field. Both fields live in the same
table. I don't want to include records where the DateRptSubmitted is the
same date as the DateEntered, because there's nothing wrong with that. How
do you write the criteria for this?

My guess is that your date field contains a time component. Regardless of how
it's formatted, #12/6/2007 11:25:31am# is in fact greater then #12/6/2007# -
since the pure date value assumes a time of midnight at the beginning of the
day.

Is it possible that the DateRptSubmitted has a time component (e.g. it's being
filled using a default value of Now()) whereas the DateEntered field is just a
pure date? Take a look in the table datasheet, or set the Format of the
textbox (temporarily perhaps) to General Date.

John W. Vinson [MVP]
 
S

Shelly Kendrick

Oh my goodness, I just had a duh moment. My query result had yet another
date field next to the DateRptSubmitted, and the DateEntered field was not
showing in my result, hence I was comparing the DateRptSubmitted field to the
wrong date field. I'm so sorry. Thank you Lance and John for your wise
advice! Lance, you were right, and John, that could potentially be the issue
for me in the future! Sorry I'm an idiot -- thank you so so much for your
feedback!!--
Shelly Kendrick
 

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

Top