Link to home
Start Free TrialLog in
Avatar of route217
route217Flag for United Kingdom of Great Britain and Northern Ireland

asked on

date value in access 2003

Hi Experts

I have in the following in my query select

Criteria Fields        Date
Value                 "What do i insert here"

I need to add a value in the above so it pull back all data from to date to year dot....backwards....
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

try something like this


<=Date()


that will return all records with dates equal to today and back


<=#9/2/2012#

will return all records with date equal to 9/2/2012 and back

i prefer using this as criteria for date range


between  dateserial(year(date()),month(date()),day(date())) and dateserial(year(date())-1,month(date()),day(date()))


that will give records with date between today and a year ago
Avatar of route217

ASKER

thanks for the feeeback...

cap1....I tried the first recommendation and go no results. ..I am trying to connect to access via excel 2003 get external data source option. ...

the table in access has data in it...
hi cap1

cut a long story short...when I try and look a the select qry..via excel. .it prompt me when a dia logue box saying enter parameter 1....
better upload a copy of the db...
and post the sql of the query you are working on.
Hi Cap1

here is the query statement....

SELECT DCData.ID, DCData.Date, DCData.CustomerType, DCData.RollNumber, DCData.Brand, DCData.DemandCategory, DCData.DemandType, DCData.Resolution1, DCData.Resolution2, DCData.Userid, DCData.DateTime, DCData.Site, DCData.Date, DCData.Date, DCData.Date
FROM DCData DCData
WHERE (DCData.Date=?)

Open in new window


I am guess because i have a ? after the equals sign when i need to pull back data that is <= Date()....

is the reason why the paramemter window is popping up all the time when i try to pull back the data into excel...
ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
works prefectly....superstar..