Solved

Microsoft Access query

Posted on 2016-09-09
4
28 Views
Last Modified: 2016-09-09
I need this query to have the impound date always be greater than current date.  e.g. todays date is 9/9, so the impound date should be equal or greater than 8/9.

SELECT SoftSlips.SoftSlip, Species.Species, Breeds.Breed, SoftSlips.ColorNu, SoftSlips.OriginalName, SoftSlips.ImpoundCode, SoftSlips.Availability, SoftSlips.ImpoundDate, SoftSlips.Intake, SoftSlips.Weight, SoftSlips.Action, Placements.Kennel, Placements.PlacementDate, Placements.PlacementEndDate
FROM (Species INNER JOIN Breeds ON Species.SpeciesID = Breeds.SpeciesID) INNER JOIN (SoftSlips INNER JOIN qryLastPLacement AS Placements ON SoftSlips.SoftSlip = Placements.SoftSlip) ON (Species.SpeciesID = SoftSlips.SpeciesID) AND (Breeds.BreedID = SoftSlips.BreedID)
WHERE (((SoftSlips.ImpoundCode) Not In ("acord","acosd","ocsd","ocrd","rtn")) AND ((SoftSlips.ImpoundDate)>#8/1/2016#) AND ((SoftSlips.Intake)="south bay") AND ((SoftSlips.Weight) Is Null) AND ((SoftSlips.Action) Is Null))
ORDER BY Species.Species, SoftSlips.Intake;
0
Comment
Question by:jrsitman
  • 2
4 Comments
 
LVL 12

Assisted Solution

by:Jeff Darling
Jeff Darling earned 150 total points
ID: 41791733
use  > date()

SELECT SoftSlips.SoftSlip, Species.Species, Breeds.Breed, SoftSlips.ColorNu, SoftSlips.OriginalName, SoftSlips.ImpoundCode, SoftSlips.Availability, SoftSlips.ImpoundDate, SoftSlips.Intake, SoftSlips.Weight, SoftSlips.Action, Placements.Kennel, Placements.PlacementDate, Placements.PlacementEndDate
FROM (Species INNER JOIN Breeds ON Species.SpeciesID = Breeds.SpeciesID) INNER JOIN (SoftSlips INNER JOIN qryLastPLacement AS Placements ON SoftSlips.SoftSlip = Placements.SoftSlip) ON (Species.SpeciesID = SoftSlips.SpeciesID) AND (Breeds.BreedID = SoftSlips.BreedID)
WHERE (((SoftSlips.ImpoundCode) Not In ("acord","acosd","ocsd","ocrd","rtn")) AND ((SoftSlips.ImpoundDate)> date()) AND ((SoftSlips.Intake)="south bay") AND ((SoftSlips.Weight) Is Null) AND ((SoftSlips.Action) Is Null))
ORDER BY Species.Species, SoftSlips.Intake;

Open in new window

0
 

Author Comment

by:jrsitman
ID: 41791742
that won't work.  That means greater than today.  I didn't clarify.  I need it to be 30 days prior to current date.  Sorry
0
 
LVL 39

Accepted Solution

by:
als315 earned 350 total points
ID: 41791766
Try
SoftSlips.ImpoundDate)>Dateadd("d",-30, Date()).
But it will give you 10th of august, because we have 31 day in august.
You can use:
Dateadd("m",-1, Date())
it will give you one month
0
 

Author Closing Comment

by:jrsitman
ID: 41791799
Gave Jeff points because my question wasn't totally clear.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now