Solved

Microsoft Access query

Posted on 2016-09-09
4
44 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:J.R. Sitman
  • 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:J.R. Sitman
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:J.R. Sitman
ID: 41791799
Gave Jeff points because my question wasn't totally clear.
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

813 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

11 Experts available now in Live!

Get 1:1 Help Now