A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Return all dates within a range



 
 
Thread Tools Display Modes
  #11  
Old May 11th, 2006, 02:31 PM posted to microsoft.public.access
Douglas J Steele
external usenet poster
 
Posts: 415
Default Return all dates within a range

I think you're still misinterpretting Karl's advice. Nowhere did he suggest
creating a table with dates in it.

What he suggested was to create a table named CountNumber, with one Long
Integer field CountNum in it. CountNum would contain numbers 1, 2, 3, 4, etc
up as high as you like. (It may be simplest to create this in Excel and
import it into your database)

Then, he suggested to create a query:

SELECT CVDate([Enter start date])+[CountNUM] AS [My Dates]
FROM CountNumber
WHERE (((CVDate([Enter start date])+[CountNUM])=CVDate([Enter end date])));

Run that query, and you'll be prompted for Start and End dates. As long as
the difference between the Start and End dates is not more days than you
have rows in the CountNumber table, you'll get back 1 row for each day.


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Joe" wrote in message
oups.com...
Thanks Karl and Doug,

Even though it bugs me to not be able to write code to solve this
problem, I'll create a permanent table with a few years worth of dates.
I appreciate your help.



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:43 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.