Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DateDiff , Recordset and Access Data Base 1

Status
Not open for further replies.

tomhughes

Vendor
Joined
Aug 8, 2001
Messages
233
Location
US
I am trying to use the DateDiff function to select dates from an Access Data Base which are within a certain date range. Does anyone know how to do this ????
 
Hi Tom,

The way I do this is to create two fields in your table, a start date and an end date. Then in your query that you make from that table in the criteria field for start date type in >=Date() and in the end date type in <=Date(). That should allow you to display data within those two given dates.

Have fun.

M
 
Thanks m

I was using the word Dates in my Access field. This may have been a problem. I changed it to myDates. It is now working. However I am trying to select the dates from the present date and then select the next 8 dates. I have tried using the ID, but with no success. This is what my Query looks like.

SELECT myDates
FROM FET
WHERE myDates>=Date()

I want to add &quot;AND ID = ID + 8&quot;, however that doesn't work.
I found some code that appears to get the ID. It appears as

ID = trim(request.querystring(&quot;ID&quot;))


however it is in string form, and I am trying to convert it to an integer. Do you have any suggestions ?????




 
Tom,

Much debate in our house about this one. As the man (Rick Curtis, he IS the man) said, code your access queries IN access, then use that query as your source for the SQl window in UD. In access setup a query and in the date field in the criteria row type in >=Date()AND<=(Date()+8). That should be a dynamic way of getting all your dates whenever they are to be available or whatever from today to 8 days hence.

Have fun

M
 
Awsome - Yes, after spending about 10 hours trying to get the date to work I tried the Access Query which I have never done before - It took me about 5 minutes to get it to work. Tell Rick HE IS THE MAN and I appreciate the info. I can't tell you how much I appreciate your help.
 
Have a public apology, my wife the lovely Mrs Misguided offered me the query solution for Tom's dilemma, so technically SHE is the Man, er...Woman. (I hope you're happy Mrs M!)

;)

M
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top