Search for records by date

  • Thread starter Haggr1 via AccessMonster.com
  • Start date
H

Haggr1 via AccessMonster.com

Because I used a "Time Stamp" with the "Date" I have to enter [That Day] and
[The Next Day]. I'm sure there is a better way. Thanks

Here's what I use


SELECT Table1.[Job Number], Table1.SetterCompany, Table1.[Date To], Table1.
[Date From], Table1.Amount, Table1.[File Number]
FROM Table1
WHERE (((Table1.SetterCompany)=[Forms]![Setter Billing]![Text18]) AND (
(Table1.[Date From]) Between [Date Looking For] And [Next Day]));


(((Table1.SetterCompany)=[Forms]![Setter Billing]![Text18]) Is the persons
records I am looking for
 
J

John W. Vinson

Because I used a "Time Stamp" with the "Date" I have to enter [That Day] and
[The Next Day]. I'm sure there is a better way. Thanks

Sure - calculate the next day on the fly:

SELECT Table1.[Job Number], Table1.SetterCompany, Table1.[Date To], Table1.
[Date From], Table1.Amount, Table1.[File Number]
FROM Table1
WHERE (((Table1.SetterCompany)=[Forms]![Setter Billing]![Text18]) AND (
(Table1.[Date From]) >= [Date Looking For] And (Table1.[Date From]) <
DateAdd("d", 1, [Date Looking For])));
 
D

Douglas J. Steele

SELECT Table1.[Job Number], Table1.SetterCompany, Table1.[Date To], Table1.
[Date From], Table1.Amount, Table1.[File Number]
FROM Table1
WHERE SetterCompany=[Forms]![Setter Billing]![Text18]
AND [Date From] Between [Date Looking For] And DateAdd("d", 1, [Date Looking
For])

Make sure you have exactly the same thing for the two parameters [Date
Looking For], or else you'll be prompted twice (copy-and-paste is a good
idea...)
 
H

Haggr1 via AccessMonster.com

That's it What do you eat "code food"?
Because I used a "Time Stamp" with the "Date" I have to enter [That Day] and
[The Next Day]. I'm sure there is a better way. Thanks

Sure - calculate the next day on the fly:

SELECT Table1.[Job Number], Table1.SetterCompany, Table1.[Date To], Table1.
[Date From], Table1.Amount, Table1.[File Number]
FROM Table1
WHERE (((Table1.SetterCompany)=[Forms]![Setter Billing]![Text18]) AND (
(Table1.[Date From]) >= [Date Looking For] And (Table1.[Date From]) <
DateAdd("d", 1, [Date Looking For])));
 

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