Re: How to combine values from 2 fields for a report



Well, that is the problem. You cannot really compare two different types of
things. You might try forcing ASAP to some date value such as today's date.

Field: Out
Criteria: > IIF(Due="ASAP" or Due is Null,Date(),CDate([Due]))




donnadele wrote:
>
> Due is Text and Out is Date Time. Sometimes they put "ASAP" in the Due
> field, so I had to make it Text. I really appreciate this. I'm spending
> way to much time trying to get this to work. Thank you.
>
> "John Spencer (MVP)" wrote:
>
> > In that case, I would guess that your fields are not DateTime fields, but are
> > actually text fields.
> >
> > Can you check and see what type of fields Due and Out (what are the real names
> > by the way) are?
> >
> > donnadele wrote:
> > >
> > > I get an error that says Data type mismatch in criteria expression when I try
> > > these.
> > >
> > > "John Spencer (MVP)" wrote:
> > >
> > > > Here is criteria that should work, although it will be slow.
> > > >
> > > > Field: Out
> > > > Criteria: > CDate(NZ([Due],#12/1/1900#))
> > > >
> > > > You could try
> > > >
> > > > Field: Out
> > > > CriteriaLine1: > Due
> > > >
> > > >
> > > > Field: Due
> > > > CriteriaLine2: Is Null
> > > >
> > > > In SQL
> > > >
> > > > WHERE Out>Due or Due Is Null
> > > >
> > > > donnadele wrote:
> > > > >
> > > > > Help please anyone!!! We are getting desperate here. OUr company president
> > > > > wants this report and we all feel rather like idiots that we can't figure out
> > > > > how to make this work.
> > > > >
> > > > > I have two fields, one is "due" and the next is "out". What we want to do
> > > > > is have a query that pulls the records from the "out" field that are greater
> > > > > than the "due" field, plus we want to include all the "out" records that are
> > > > > null. Can this be done?
> > > > >
> > > > > "donnadele" wrote:
> > > > >
> > > > > > What I am trying to do is make a report that shows when out dates are later
> > > > > > than thier due dates plus when the out dates are left blank. I need a query
> > > > > > that will pull both the dates greater than the due date, and those that are
> > > > > > null. Does that help?
> > > > > >
> > > > > > "John H W" wrote:
> > > > > >
> > > > > > > I am not really sure what you need, but as far as the query is concerned, try:
> > > > > > > WHERE [due date] < #show date# AND [second field] = #12:00:00 AM#
> > > > > > >
> > > > > > > Hopy this helps some.
> > > > > > >
> > > > > > > John H W
> > > > > > >
> > > > > > > "donnadele" wrote:
> > > > > > >
> > > > > > > > I am trying to build an expression in a query that will show dates that are
> > > > > > > > greater than the due date in one field and is null in the second field which
> > > > > > > > is the out date. We are putting this expression in the criteria of the out
> > > > > > > > date field. Can anyone help me?
> > > >
> >
.