Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Microsoft Access query

Posted on 2016-09-09
4
Medium Priority
?
84 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 13

Assisted Solution

by:Jeff Darling
Jeff Darling earned 600 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 1400 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

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
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 …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

963 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