Solved

Microsoft Access query

Posted on 2016-09-09
4
61 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 13

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 40

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

617 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