Query Date Problem

  • Thread starter Thread starter Bob Vance
  • Start date Start date
B

Bob Vance

Trying to query any record back 30 days with a date and anything record
without a date
 
Trying to query any record back 30 days with a date and anything record
without a date

WHERE YourTable.DateField Is Null OR YourTable.DateField Between
Date() And Date()-30;
 
fredg said:
WHERE YourTable.DateField Is Null OR YourTable.DateField Between
Date() And Date()-30;

Thanks fred, but I am not getting Clients that have no date
showing...Regards Bob

Between Date()-30 And Date()-3000 And Is Null Or Between Date()-30 And
Date()-3000
 
Bob Vance said:
Thanks fred, but I am not getting Clients that have no date
showing...Regards Bob

Between Date()-30 And Date()-3000 And Is Null Or Between Date()-30 And
Date()-3000
Actally got some of it going but now BachInvoice and Payable not
working..Regards Bob

WHERE (((tblOwnerInfo.BachInvoice)=True) AND ((tblOwnerInfo.EmailDateState)
Between Date()-30 And Date()-3000)) OR
(((DLookUp("[Payable]","[qryOverdueAll]","[OwnerID] = " & [OwnerID]))>1) AND
((tblOwnerInfo.EmailDateState) Is Null))
 
Bob Vance said:
Bob Vance said:
Thanks fred, but I am not getting Clients that have no date
showing...Regards Bob

Between Date()-30 And Date()-3000 And Is Null Or Between Date()-30 And
Date()-3000
Actally got some of it going but now BachInvoice and Payable not
working..Regards Bob

WHERE (((tblOwnerInfo.BachInvoice)=True) AND
((tblOwnerInfo.EmailDateState) Between Date()-30 And Date()-3000)) OR
(((DLookUp("[Payable]","[qryOverdueAll]","[OwnerID] = " & [OwnerID]))>1)
AND ((tblOwnerInfo.EmailDateState) Is Null))
Just cant get the Is Null, Date to sort, brings up all records, when I take
away Is Null getting right result except if record has no date and is true
and >1

WHERE (((tblOwnerInfo.BachInvoice)=True) AND
((DLookUp("[Payable]","[qryOverdueAll]","[OwnerID] = " & [OwnerID]))>1) AND
((tblOwnerInfo.EmailDateState) Between Date()-30 And Date()-3000))
 
Try this:

WHERE (((tblOwnerInfo.BachInvoice)=True) AND
((DLookUp("[Payable]","[qryOverdueAll]","[OwnerID] = " & [OwnerID]))>1) AND
((tblOwnerInfo.EmailDateState) Between Date()-30 And Date()-3000 OR
tblOwnerInfo.EmailDateState IS NULL))

--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/


Bob Vance said:
Bob Vance said:
Bob Vance said:
On Sun, 14 Jun 2009 12:36:03 +1200, Bob Vance wrote:

Trying to query any record back 30 days with a date and anything
record
without a date

WHERE YourTable.DateField Is Null OR YourTable.DateField Between
Date() And Date()-30;

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

Thanks fred, but I am not getting Clients that have no date
showing...Regards Bob

Between Date()-30 And Date()-3000 And Is Null Or Between Date()-30 And
Date()-3000
Actally got some of it going but now BachInvoice and Payable not
working..Regards Bob

WHERE (((tblOwnerInfo.BachInvoice)=True) AND
((tblOwnerInfo.EmailDateState) Between Date()-30 And Date()-3000)) OR
(((DLookUp("[Payable]","[qryOverdueAll]","[OwnerID] = " & [OwnerID]))>1)
AND ((tblOwnerInfo.EmailDateState) Is Null))
Just cant get the Is Null, Date to sort, brings up all records, when I
take away Is Null getting right result except if record has no date and is
true and >1

WHERE (((tblOwnerInfo.BachInvoice)=True) AND
((DLookUp("[Payable]","[qryOverdueAll]","[OwnerID] = " & [OwnerID]))>1)
AND ((tblOwnerInfo.EmailDateState) Between Date()-30 And Date()-3000))
 
Thanks Ken, In a word BRILLIANT!! ...Regards Bob

Ken Snell said:
Try this:

WHERE (((tblOwnerInfo.BachInvoice)=True) AND
((DLookUp("[Payable]","[qryOverdueAll]","[OwnerID] = " & [OwnerID]))>1)
AND
((tblOwnerInfo.EmailDateState) Between Date()-30 And Date()-3000 OR
tblOwnerInfo.EmailDateState IS NULL))

--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/


Bob Vance said:
Bob Vance said:
On Sun, 14 Jun 2009 12:36:03 +1200, Bob Vance wrote:

Trying to query any record back 30 days with a date and anything
record
without a date

WHERE YourTable.DateField Is Null OR YourTable.DateField Between
Date() And Date()-30;

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

Thanks fred, but I am not getting Clients that have no date
showing...Regards Bob

Between Date()-30 And Date()-3000 And Is Null Or Between Date()-30 And
Date()-3000

Actally got some of it going but now BachInvoice and Payable not
working..Regards Bob

WHERE (((tblOwnerInfo.BachInvoice)=True) AND
((tblOwnerInfo.EmailDateState) Between Date()-30 And Date()-3000)) OR
(((DLookUp("[Payable]","[qryOverdueAll]","[OwnerID] = " & [OwnerID]))>1)
AND ((tblOwnerInfo.EmailDateState) Is Null))
Just cant get the Is Null, Date to sort, brings up all records, when I
take away Is Null getting right result except if record has no date and
is true and >1

WHERE (((tblOwnerInfo.BachInvoice)=True) AND
((DLookUp("[Payable]","[qryOverdueAll]","[OwnerID] = " & [OwnerID]))>1)
AND ((tblOwnerInfo.EmailDateState) Between Date()-30 And Date()-3000))
 
Back
Top